-
Notifications
You must be signed in to change notification settings - Fork 8
/
svelte.config.js
65 lines (61 loc) · 1.85 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
60
61
62
63
64
65
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
import { mdsvex } from 'mdsvex';
import remarkTableOfContents from './plugins/remark-table-of-content.js';
import remarkImageExternal from './plugins/remark-image-external.js';
import remarkTwitterOg from './plugins/remark-twitter-og.js';
import remarkScript from './plugins/remark-script.js';
import remarkDescription from './plugins/remark-description.js';
import rehypeInlineCode from './plugins/rehype-inline-code.js';
import adapter from '@sveltejs/adapter-static';
import customCodeHighlight from './plugins/code-highlight.js';
import path from 'path';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: [
vitePreprocess(),
mdsvex({
smartypants: false,
extensions: ['.svx', '.md', '.mdx'],
remarkPlugins: [
remarkDescription,
[remarkTableOfContents, { exclude: /\/slides\// }],
remarkImageExternal,
[remarkTwitterOg, { exclude: /\/slides\// }],
remarkScript
],
rehypePlugins: [rehypeInlineCode],
layout: {
talk: './src/lib/TalkLayout.svelte',
slide: './src/lib/SlideLayout.svelte',
_: './src/lib/BlogLayout.svelte'
},
highlight: {
highlighter: customCodeHighlight
}
})
],
kit: {
adapter: adapter({
// default options are shown
pages: 'docs',
assets: 'docs',
fallback: null,
// NOTE? fallback 404 page?
// fallback: '404.html',
precompress: false
}),
prerender: {
entries: ['*', '/rss.xml', '/series', '/tags'],
handleMissingId: 'warn',
},
paths: {
assets: 'https://lihautan.com'
}
// routes: (filepath) => !/(?:(?:^_|\/_)|(?:^\.|\/\.)(?!well-known)|(\/_\/))/.test(filepath),
// trailingSlash: 'always'
},
extensions: ['.svelte', '.md', '.mdx']
};
export default config;