2023-07-24 22:11:54 +05:30
|
|
|
// import adapter from '@sveltejs/adapter-auto';
|
|
|
|
import adapter from '@sveltejs/adapter-static';
|
2023-01-19 22:35:09 +05:30
|
|
|
import { vitePreprocess } from '@sveltejs/kit/vite';
|
2023-12-29 20:44:25 +05:30
|
|
|
import { mdsvex, escapeSvelte } from 'mdsvex';
|
|
|
|
import shiki from 'shiki';
|
|
|
|
import math from 'remark-math';
|
|
|
|
import rehype from 'remark-rehype';
|
|
|
|
//import rehypeMathjax from 'rehype-mathjax';
|
|
|
|
import rehypeKatex from 'rehype-katex';
|
2023-01-19 22:35:09 +05:30
|
|
|
|
|
|
|
/** @type {import('@sveltejs/kit').Config} */
|
|
|
|
const config = {
|
|
|
|
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
|
|
|
|
// for more information about preprocessors
|
2023-12-29 20:44:25 +05:30
|
|
|
preprocess: [
|
|
|
|
vitePreprocess(),
|
|
|
|
mdsvex({
|
|
|
|
extensions: ['.md', 'svx'],
|
|
|
|
layout: 'src/lib/blog/+post.svelte',
|
|
|
|
highlight: {
|
|
|
|
highlighter: async (code, lang = 'text') => {
|
|
|
|
const highlighter = await shiki.getHighlighter({ theme: 'dracula' });
|
|
|
|
const html = escapeSvelte(highlighter.codeToHtml(code, { lang }));
|
|
|
|
return `{@html \`${html}\` }`;
|
|
|
|
},
|
|
|
|
alias: {
|
|
|
|
js: 'javascript',
|
|
|
|
sh: 'bash',
|
|
|
|
glsl: 'glsl'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
remarkPlugins: [[math, rehype]],
|
|
|
|
rehypePlugins: [[rehypeKatex]]
|
|
|
|
})
|
|
|
|
],
|
|
|
|
extensions: ['.svelte', '.md', '.svx'],
|
2023-01-19 22:35:09 +05:30
|
|
|
|
|
|
|
kit: {
|
2023-12-24 15:20:31 +05:30
|
|
|
adapter: adapter({
|
|
|
|
pages: 'build',
|
|
|
|
assets: 'build',
|
|
|
|
fallback: null,
|
|
|
|
precompress: false,
|
|
|
|
strict: false
|
|
|
|
})
|
2023-01-19 22:35:09 +05:30
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export default config;
|