feat: initial commit

(cherry picked from commit 44c4d7b9521fe449e61edc614446195861932f8c)
This commit is contained in:
saicaca
2023-09-26 14:27:38 +08:00
parent 02b0a65314
commit 124843848f
58 changed files with 13083 additions and 0 deletions

49
astro.config.mjs Normal file
View File

@@ -0,0 +1,49 @@
import { defineConfig } from 'astro/config';
import yaml from '@rollup/plugin-yaml';
import icon from "astro-icon";
import tailwind from "@astrojs/tailwind";
import {remarkReadingTime} from "./src/plugins/remark-reading-time.mjs";
import Color from 'colorjs.io';
// https://astro.build/config
const oklchToHex = function (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"});
}
export default defineConfig({
integrations: [
tailwind(),
icon({
include: {
'material-symbols': ['*'],
'fa6-brands': ['*']
}
})
],
markdown: {
remarkPlugins: [remarkReadingTime],
},
redirects: {
'/': '/page/1',
},
vite: {
plugins: [yaml()],
css: {
preprocessorOptions: {
stylus: {
define: {
oklchToHex: oklchToHex
}
}
}
}
},
});