1
0
website/svelte.config.js

63 lines
1.2 KiB
JavaScript
Raw Normal View History

2024-08-15 00:43:18 +03:00
import adapter from "svelte-adapter-bun";
2024-07-11 15:51:49 +03:00
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
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 = {
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
);
}
},
},
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-08-15 00:43:18 +03:00
blogpost: './src/routes/entries/_layout.svelte',
2024-08-08 04:46:38 +03:00
},
}),
],
2024-07-11 15:51:49 +03:00
kit: {
2024-08-15 00:43:18 +03:00
prerender: {
handleHttpError: 'warn',
},
adapter: adapter({
precompress: true,
}),
2024-07-11 15:51:49 +03:00
}
};
export default config;