mirror of
https://codeberg.org/HPCesia/AstralHalo.git
synced 2025-04-08 17:34:27 +08:00
- Upgrade TailwindCSS to v4 - Upgrade daisyUI to v5 beta. - Delete the PostCSS TailwindCSS compatibility layer. - Delete Sass dependency because TailwindCSS v4 will generate nested CSS, so we don't need Sass anymore.
82 lines
2.1 KiB
JavaScript
82 lines
2.1 KiB
JavaScript
// @ts-check
|
|
import { CDN } from './src/constants/cdn.mjs';
|
|
import { rehypeWrapTables } from './src/plugins/rehype-wrap-tables.mjs';
|
|
import { remarkExcerpt } from './src/plugins/remark-excerpt';
|
|
import { remarkReadingTime } from './src/plugins/remark-reading-time.mjs';
|
|
import { rehypeHeadingIds } from '@astrojs/markdown-remark';
|
|
import sitemap from '@astrojs/sitemap';
|
|
import tailwindcss from '@tailwindcss/vite';
|
|
import icon from 'astro-icon';
|
|
import pagefind from 'astro-pagefind';
|
|
import { defineConfig } from 'astro/config';
|
|
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
|
|
import rehypeMathJaxCHtml from 'rehype-mathjax/chtml';
|
|
import remarkGithubBlockQuote from 'remark-github-beta-blockquote-admonitions';
|
|
import remarkMath from 'remark-math';
|
|
|
|
// https://astro.build/config
|
|
export default defineConfig({
|
|
site: 'https://astral-halo.netilify.app/',
|
|
base: '/',
|
|
output: 'static',
|
|
trailingSlash: 'ignore',
|
|
integrations: [
|
|
icon(),
|
|
sitemap({ filter: (page) => !page.includes('/archives/') && !page.includes('/about/') }),
|
|
pagefind(),
|
|
],
|
|
markdown: {
|
|
shikiConfig: {
|
|
themes: {
|
|
light: 'one-light',
|
|
dark: 'one-dark-pro',
|
|
},
|
|
defaultColor: false,
|
|
},
|
|
remarkPlugins: [
|
|
remarkMath,
|
|
remarkReadingTime,
|
|
remarkExcerpt,
|
|
// @ts-expect-error - types are not up to date
|
|
[
|
|
remarkGithubBlockQuote,
|
|
{
|
|
classNameMaps: {
|
|
block: (/** @type {string} */ title) =>
|
|
`admonition admonition-${title.toLowerCase()}`,
|
|
title: 'admonition-title',
|
|
},
|
|
},
|
|
],
|
|
],
|
|
rehypePlugins: [
|
|
rehypeHeadingIds,
|
|
[
|
|
rehypeAutolinkHeadings,
|
|
{
|
|
behavior: 'append',
|
|
content: {
|
|
type: 'text',
|
|
value: '#',
|
|
},
|
|
properties: {
|
|
'aria-label': 'Anchor link',
|
|
},
|
|
},
|
|
],
|
|
[
|
|
rehypeMathJaxCHtml,
|
|
{
|
|
chtml: {
|
|
fontURL: CDN.mathjaxFont,
|
|
},
|
|
},
|
|
],
|
|
rehypeWrapTables,
|
|
],
|
|
},
|
|
vite: {
|
|
plugins: [tailwindcss()],
|
|
},
|
|
});
|