2024-08-22 23:54:03 +03:00
|
|
|
import adapter from 'svelte-adapter-bun';
|
2024-07-11 15:51:49 +03:00
|
|
|
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
|
|
|
|
2024-08-08 03:33:36 +03:00
|
|
|
import { mdsvex } from 'mdsvex'
|
|
|
|
import rehypeAutolinkHeadings from 'rehype-autolink-headings'
|
|
|
|
import rehypeSlug from 'rehype-slug'
|
|
|
|
|
2024-08-15 00:43:18 +03:00
|
|
|
import * as toml from "@std/toml";
|
|
|
|
|
2024-07-11 15:51:49 +03:00
|
|
|
/** @type {import('@sveltejs/kit').Config} */
|
|
|
|
const config = {
|
2024-08-08 03:33:36 +03:00
|
|
|
extensions: ['.svelte', '.md', '.svx'],
|
|
|
|
|
|
|
|
preprocess: [
|
|
|
|
vitePreprocess(),
|
|
|
|
mdsvex({
|
|
|
|
extensions: ['.md', '.svx'],
|
2024-08-15 00:43:18 +03:00
|
|
|
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
|
|
|
|
);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
2024-08-08 03:33:36 +03:00
|
|
|
rehypePlugins: [
|
|
|
|
rehypeSlug,
|
|
|
|
rehypeAutolinkHeadings,
|
|
|
|
],
|
2024-08-15 00:43:18 +03:00
|
|
|
smartypants: {
|
|
|
|
dashes: 'oldschool',
|
|
|
|
quotes: true,
|
|
|
|
ellipses: true,
|
|
|
|
backticks: false,
|
|
|
|
},
|
2024-08-08 04:46:38 +03:00
|
|
|
layout: {
|
2024-09-30 02:23:40 +03:00
|
|
|
about: './src/routes/about/_layout.svelte',
|
2024-08-15 00:43:18 +03:00
|
|
|
blogpost: './src/routes/entries/_layout.svelte',
|
2024-08-08 04:46:38 +03:00
|
|
|
},
|
2024-08-08 03:33:36 +03:00
|
|
|
}),
|
|
|
|
],
|
2024-07-11 15:51:49 +03:00
|
|
|
|
|
|
|
kit: {
|
2024-08-23 18:23:52 +03:00
|
|
|
csrf: {
|
|
|
|
checkOrigin: false,
|
|
|
|
},
|
2024-08-15 00:43:18 +03:00
|
|
|
prerender: {
|
|
|
|
handleHttpError: 'warn',
|
|
|
|
},
|
2024-08-08 03:33:36 +03:00
|
|
|
adapter: adapter({
|
|
|
|
precompress: true,
|
|
|
|
}),
|
2024-07-11 15:51:49 +03:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export default config;
|