Блоги #1
3 changed files with 21 additions and 5 deletions
|
|
@ -1,3 +0,0 @@
|
||||||
export default {
|
|
||||||
extensions: ['.md']
|
|
||||||
};
|
|
||||||
11
src/lib/components/MdsvexLayout.svelte
Normal file
11
src/lib/components/MdsvexLayout.svelte
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
<script lang="ts" module>
|
||||||
|
import SocialHyperlink from './SocialHyperlink.svelte';
|
||||||
|
|
||||||
|
export { SocialHyperlink as a };
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
const { children, ...rest } = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{@render children()}
|
||||||
|
|
@ -1,8 +1,13 @@
|
||||||
import adapter from '@sveltejs/adapter-static';
|
import adapter from '@sveltejs/adapter-static';
|
||||||
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
||||||
import { mdsvex } from 'mdsvex';
|
import { mdsvex } from 'mdsvex';
|
||||||
import mdsvexConfig from './mdsvex.config.js';
|
|
||||||
import autoImport from 'sveltekit-autoimport';
|
import autoImport from 'sveltekit-autoimport';
|
||||||
|
import { join, dirname } from 'path';
|
||||||
|
import { fileURLToPath } from 'url';
|
||||||
|
|
||||||
|
// https://flaviocopes.com/fix-dirname-not-defined-es-module-scope/
|
||||||
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
|
const __dirname = dirname(__filename);
|
||||||
|
|
||||||
/** @type {import('@sveltejs/kit').Config} */
|
/** @type {import('@sveltejs/kit').Config} */
|
||||||
const config = {
|
const config = {
|
||||||
|
|
@ -34,7 +39,10 @@ const config = {
|
||||||
extensions: ['.svelte', '.md'],
|
extensions: ['.svelte', '.md'],
|
||||||
preprocess: [
|
preprocess: [
|
||||||
vitePreprocess(),
|
vitePreprocess(),
|
||||||
mdsvex(mdsvexConfig),
|
mdsvex({
|
||||||
|
extensions: ['.md'],
|
||||||
|
layout: join(__dirname, "./src/lib/components/MdsvexLayout.svelte")
|
||||||
|
}),
|
||||||
autoImport({
|
autoImport({
|
||||||
include: ['**/*.(svelte|md)'],
|
include: ['**/*.(svelte|md)'],
|
||||||
components: ['./src/lib/components/', { name: './src' }]
|
components: ['./src/lib/components/', { name: './src' }]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue