This commit is contained in:
saicaca
2024-08-16 00:08:27 +08:00
parent 411947bc4e
commit d58061ccae
17 changed files with 466 additions and 537 deletions

View File

@@ -5,7 +5,6 @@ import swup from '@swup/astro';
import Compress from "astro-compress"
import icon from "astro-icon"
import { defineConfig } from "astro/config"
import Color from "colorjs.io"
import rehypeAutolinkHeadings from "rehype-autolink-headings"
import rehypeComponents from "rehype-components"; /* Render the custom directive content */
import rehypeKatex from "rehype-katex"
@@ -19,23 +18,15 @@ import {parseDirectiveNode} from "./src/plugins/remark-directive-rehype.js";
import { remarkReadingTime } from "./src/plugins/remark-reading-time.mjs"
import {remarkExcerpt} from "./src/plugins/remark-excerpt.js";
const oklchToHex = (str) => {
const DEFAULT_HUE = 250
const regex = /-?\d+(\.\d+)?/g
const matches = str.string.match(regex)
const lch = [matches[0], matches[1], DEFAULT_HUE]
return new Color("oklch", lch).to("srgb").toString({
format: "hex",
})
}
// https://astro.build/config
export default defineConfig({
site: "https://fuwari.vercel.app/",
base: "/",
trailingSlash: "always",
integrations: [
tailwind(),
tailwind({
nesting: true
}),
swup({
theme: false,
animationClass: 'transition-swup-', // see https://swup.js.org/options/#animationselector
@@ -120,14 +111,5 @@ export default defineConfig({
}
}
},
css: {
preprocessorOptions: {
stylus: {
define: {
oklchToHex: oklchToHex,
},
},
},
},
},
})