-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsvelte.config.js
60 lines (59 loc) · 1.89 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
import { preprocessMeltUI, sequence } from '@melt-ui/pp';
import { mdsvex } from 'mdsvex';
import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
import rehypeExternalLinks from 'rehype-external-links';
import rehypeSlug from 'rehype-slug';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import rehypePrettyCode from 'rehype-pretty-code';
/** @type {import('mdsvex').MdsvexOptions}*/
const mdsvexOptions = {
extensions: ['.md'],
rehypePlugins: [
rehypeExternalLinks,
rehypeSlug,
[
rehypeAutolinkHeadings,
{
behavior: 'prepend',
properties: { className: ['heading-link'], title: 'Permalink', ariaHidden: 'true' },
content: {
type: 'element',
tagName: 'span',
properties: {},
children: [{ type: 'text', value: '#' }]
}
}
],
[
rehypePrettyCode,
{
theme: 'github-dark',
onVisitLine(node) {
if (node.children.length === 0) {
node.children = [{ type: 'text', value: '↹↹↹' }];
}
}
}
]
]
};
/** @type {import('@sveltejs/kit').Config}*/
const config = {
// Consult https://svelte.dev/docs/kit/integrations
// for more information about preprocessors
preprocess: sequence([vitePreprocess(), mdsvex(mdsvexOptions), preprocessMeltUI()]),
kit: {
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
adapter: adapter({
// The base path for your GitHub Pages deployment (for example, if it's in a subpath like https://github.com/username/repo-name/)
paths: {
base: process.env.NODE_ENV === 'production' ? '/torrust-website' : ''
}
})
},
extensions: ['.svelte', '.svx', '.md']
};
export default config;