First few blogs.

This commit is contained in:
Alfred Jophy 2026-02-22 14:08:51 +05:30
commit 702469464e
19 changed files with 719 additions and 28 deletions

View file

@ -1,11 +1,40 @@
import { mdsvex } from 'mdsvex';
import { mdsvex, escapeSvelte } from 'mdsvex';
import adapter from '@sveltejs/adapter-static';
import { createHighlighter } from 'shiki';
const theme = 'github-dark';
const highlighter = await createHighlighter({
themes: [theme],
langs: [
'javascript',
'typescript',
'bash',
'json',
'css',
'html',
'markdown',
'svelte',
'xml',
'yaml',
'c',
'c++',
'go',
'ini'
]
});
/** @type {import('@sveltejs/kit').Config} */
const config = {
kit: { adapter: adapter() },
preprocess: [mdsvex()],
extensions: ['.svelte', '.svx']
kit: { adapter: adapter() },
preprocess: [mdsvex({
highlight: {
highlighter: async (code, lang = 'text') => {
const html = escapeSvelte(highlighter.codeToHtml(code, { lang, theme }));
return `{@html \`${html}\` }`;
}
}
})],
extensions: ['.svelte', '.svx']
};
export default config;