-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsvelte.config.js
40 lines (37 loc) · 1013 Bytes
/
svelte.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/** @type {import('@sveltejs/kit').Config} */
import { mdsvex, escapeSvelte } from "mdsvex";
import preprocess from "svelte-preprocess";
import adapter from "@sveltejs/adapter-static";
import { createHighlighter } from 'shiki';
const theme = 'github-dark';
const highlighter = await createHighlighter({
themes: [theme],
langs: ['javascript', 'typescript', 'php', 'vim', 'vue']
});
const config = {
extensions: [".svelte", ".md", ".svelte.md"],
preprocess: [
mdsvex({
extensions: [".svelte.md", ".md", ".svx"],
layout: {
post: "./src/components/MarkdownLayout.svelte",
"work-log": "./src/components/MarkdownLayout.svelte",
},
highlight: {
highlighter: async (code, lang = 'text') => {
const html = escapeSvelte(highlighter.codeToHtml(code, { lang, theme }));
return `{@html \`${html}\` }`;
}
},
}),
preprocess({
scss: {
prependData: "@import 'src/lib/styles/variables.scss';",
},
}),
],
kit: {
adapter: adapter(),
},
};
export default config;