add VISIBLE_DRAFT for showing drafts in the list
All checks were successful
Build & Depoly / Depoly blog (push) Successful in 1m41s

This commit is contained in:
thislight 2025-04-26 14:21:07 +08:00
parent 9ec980839a
commit 85ded53035
3 changed files with 42 additions and 22 deletions

View file

@ -1,23 +1,36 @@
import { defineConfig } from "astro/config";
import { defineConfig, envField } from "astro/config";
import solidJs from "@astrojs/solid-js";
import mdx from "@astrojs/mdx";
import icon from "astro-icon";
import paths from "node:path"
import paths from "node:path";
import rehypeBuckTable from "~/support/rehype-buck-tables";
// https://astro.build/config
export default defineConfig({
integrations: [solidJs(), mdx(), icon(), {
name: "inject-cloudflare-headers",
"hooks": {
"astro:config:setup": ({injectRoute}) => {
injectRoute({
pattern: "/_headers",
entrypoint: "./src/pages/_headers.ts",
})
}
}
}
env: {
schema: {
VISIBLE_DRAFT: envField.boolean({
context: "server",
access: "public",
default: false,
}),
},
},
integrations: [
solidJs(),
mdx(),
icon(),
{
name: "inject-cloudflare-headers",
hooks: {
"astro:config:setup": ({ injectRoute }) => {
injectRoute({
pattern: "/_headers",
entrypoint: "./src/pages/_headers.ts",
});
},
},
},
],
markdown: {
rehypePlugins: [rehypeBuckTable],
@ -25,14 +38,14 @@ export default defineConfig({
themes: {
light: "github-light",
dark: "github-dark",
}
}
},
},
},
vite: {
resolve: {
alias: {
"~": paths.resolve(import.meta.dir, "src")
}
}
}
"~": paths.resolve(import.meta.dir, "src"),
},
},
},
});