mirror of
https://github.com/hyprwm/hyprland-website.git
synced 2024-12-23 02:39:48 +01:00
34 lines
954 B
JavaScript
Executable file
34 lines
954 B
JavaScript
Executable file
import adapter from '@sveltejs/adapter-static'
|
|
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
|
|
import { mdsvex, escapeSvelte } from 'mdsvex'
|
|
import { getHighlighter } from 'shiki'
|
|
import remarkUnwrapImages from 'remark-unwrap-images'
|
|
import rehypeSlug from 'rehype-slug'
|
|
|
|
/** @type {import('mdsvex').MdsvexOptions} */
|
|
const mdsvexOptions = {
|
|
extensions: ['.md'],
|
|
highlight: {
|
|
highlighter: async (code, lang = 'text') => {
|
|
const highlighter = await getHighlighter({ theme: 'github-dark' })
|
|
const html = escapeSvelte(highlighter.codeToHtml(code, { lang }))
|
|
return `{@html \`${html}\` }`
|
|
}
|
|
},
|
|
remarkPlugins: [remarkUnwrapImages],
|
|
rehypePlugins: [rehypeSlug]
|
|
}
|
|
|
|
/** @type {import('@sveltejs/kit').Config} */
|
|
const config = {
|
|
extensions: ['.svelte', '.md'],
|
|
kit: {
|
|
adapter: adapter(),
|
|
alias: {
|
|
$components: './src/lib/components'
|
|
}
|
|
},
|
|
preprocess: [vitePreprocess(), mdsvex(mdsvexOptions)]
|
|
}
|
|
|
|
export default config
|