mdsvex fixes

This commit is contained in:
Benjamin Palko 2026-01-27 09:38:29 -05:00
parent 832ef7f411
commit a515a2a687
26 changed files with 585 additions and 179 deletions

View file

@ -1,21 +1,32 @@
import { mdsvex } from 'mdsvex';
import adapter from '@sveltejs/adapter-netlify';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
import { join } from 'path';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://svelte.dev/docs/kit/integrations
// for more information about preprocessors
preprocess: [vitePreprocess(), mdsvex({ extensions: ['.md'] })],
// Consult https://svelte.dev/docs/kit/integrations
// for more information about preprocessors
preprocess: [vitePreprocess(), mdsvex({
extensions: ['.md'], layout: {
blog: join(import.meta.dirname, './src/lib/layout/Blog.svelte')
},
highlight: {
highlighter: (code, lang, meta) => {
console.log(meta);
return `<Components.pre code={\`${code}\`} lang={\`${lang}\`} />`;
}
}
})],
kit: {
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
adapter: adapter()
},
kit: {
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
adapter: adapter()
},
extensions: ['.svelte', '.md']
extensions: ['.svelte', '.md']
};
export default config;