blog/astro.config.ts
2025-01-13 02:50:27 +00:00

77 lines
1.7 KiB
TypeScript

import mdx from '@astrojs/mdx'
import sitemap from '@astrojs/sitemap'
import swup from '@swup/astro'
import compress from 'astro-compress'
import robotsTxt from 'astro-robots-txt'
import { defineConfig } from 'astro/config'
import rehypeAutolinkHeadings from 'rehype-autolink-headings'
import rehypeKatex from 'rehype-katex'
import rehypeSlug from 'rehype-slug'
import remarkMath from 'remark-math'
import UnoCSS from 'unocss/astro'
import { themeConfig } from './src/config'
export default defineConfig({
site: themeConfig.site.url,
base: '/',
trailingSlash: 'always', // whether the URL ends with a slash
markdown: {
remarkPlugins: [remarkMath],
rehypePlugins: [
rehypeKatex,
rehypeSlug,
[rehypeAutolinkHeadings, {
behavior: 'append',
properties: {
className: ['anchor'],
},
content: {
type: 'element',
tagName: 'span',
properties: {
'className': ['anchor-icon'],
'data-pagefind-ignore': true,
},
children: [
{
type: 'text',
value: '#',
},
],
},
}],
],
shikiConfig: {
theme: 'github-dark',
wrap: true,
},
},
integrations: [
UnoCSS({
injectReset: true,
}),
mdx(),
sitemap(),
robotsTxt(),
compress({
CSS: true,
HTML: true,
Image: true,
JavaScript: true,
SVG: true,
}),
swup({
theme: false,
animationClass: 'transition-swup-',
cache: true,
preload: true,
accessibility: true,
smoothScrolling: true,
updateHead: true,
updateBodyClass: true,
}),
],
devToolbar: {
enabled: false,
},
})