forked from YeungKC/Hakuba
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsvelte.config.js
59 lines (53 loc) · 1.47 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import adapter from '@sveltejs/adapter-static';
import preprocess from 'svelte-preprocess';
import { mdsvex } from 'mdsvex';
import rehypeSlug from 'rehype-slug';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import rehypeExternalLinks from 'rehype-external-links';
import addClasses from 'rehype-add-classes';
import remarkMath from 'remark-math';
import remarkGithub from 'remark-github';
import remarkFootnotes from 'remark-footnotes';
import rehypeKatexSvelte from 'rehype-katex-svelte';
import dotenv from 'dotenv';
dotenv.config();
/** @type {import('@sveltejs/kit').Config} */
const config = {
extensions: ['.svelte', '.md'],
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: [
preprocess({
preserve: ['ld+json'],
postcss: true
}),
mdsvex({
extensions: ['.md'],
highlight: {
alias: { vue: 'html' }
},
remarkPlugins: [
remarkMath,
[remarkGithub, { repository: `${process.env.GITHUB_USER}/${process.env.REPOSITORY}` }],
remarkFootnotes
],
rehypePlugins: [
rehypeKatexSvelte,
rehypeSlug,
rehypeAutolinkHeadings,
[rehypeExternalLinks, { target: '_blank' }],
[addClasses, { 'h1,h2,h3,h4,h5,h6': 'group' }]
],
layout: 'src/routes/__layout-md.svelte'
})
],
kit: {
adapter: adapter({ fallback: '404.html' }),
prerender: {
default: true
},
trailingSlash: 'always',
inlineStyleThreshold: 1024 * 32
}
};
export default config;