-
Notifications
You must be signed in to change notification settings - Fork 0
/
svelte.config.js
67 lines (61 loc) · 1.29 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
66
67
import adapter from 'svelte-adapter-bun';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
import { mdsvex } from 'mdsvex'
import rehypeAutolinkHeadings from 'rehype-autolink-headings'
import rehypeSlug from 'rehype-slug'
import * as toml from "@std/toml";
/** @type {import('@sveltejs/kit').Config} */
const config = {
extensions: ['.svelte', '.md', '.svx'],
preprocess: [
vitePreprocess(),
mdsvex({
extensions: ['.md', '.svx'],
frontmatter: {
type: "toml",
marker: "+",
parse(frontmatter, messages) {
try {
return toml.parse(frontmatter);
} catch (e) {
messages.push(
"Parsing error on line " +
e.line +
", column " +
e.column +
": " +
e.message
);
}
},
},
rehypePlugins: [
rehypeSlug,
rehypeAutolinkHeadings,
],
smartypants: {
dashes: 'oldschool',
quotes: true,
ellipses: true,
backticks: false,
},
layout: {
about: './src/routes/about/_layout.svelte',
blogpost: './src/routes/entries/_layout.svelte',
simple: './src/components/_window_layout.svelte',
},
}),
],
kit: {
csrf: {
checkOrigin: false,
},
prerender: {
handleHttpError: 'warn',
},
adapter: adapter({
precompress: true,
}),
}
};
export default config;