-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsvelte.config.js
48 lines (43 loc) · 1.37 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
import adapter from "@sveltejs/adapter-static";
import { mdsvex } from 'mdsvex'
import { vitePreprocess } from '@sveltejs/kit/vite';
/* mdsvex plugins */
import relativeImages from "mdsvex-relative-images"; /* Relative image paths */
import rehypeKatexSvelte from "rehype-katex-svelte"; /* LaTeX */
import remarkMath from 'remark-math' /* LaTeX */
import rehypeSlug from 'rehype-slug' /* Autolink headings */
import rehypeAutolinkHeadings from 'rehype-autolink-headings' /* Autolink headings */
import remarkCaptions from 'remark-captions' /* Captions */
import remarkAttr from "remark-attr" /* HTML attributes for markdown */
import remarkInferDescriptionMeta from './mdsvex/infer-description.js'
/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: [
vitePreprocess(),
mdsvex({
extensions: ['.md'],
smartypants: true,
remarkPlugins: [
relativeImages,
remarkMath,
remarkAttr,
remarkInferDescriptionMeta,
[remarkCaptions, { external: { table: 'Caption:', code: 'Caption:', math: 'Caption:'}, internal: { image: 'Caption:' }}]
],
rehypePlugins: [
rehypeSlug,
rehypeKatexSvelte,
[rehypeAutolinkHeadings, { behavior: 'append' }],
]
})
],
extensions: ['.svelte', '.md'],
kit: {
adapter: adapter({
pages: 'build',
assets: 'build',
fallback: null // TODO: make 404 page
})
}
};
export default config;