|
| 1 | +import mdx from "@astrojs/mdx"; |
| 2 | +import sitemap from "@astrojs/sitemap"; |
| 3 | +import { |
| 4 | + transformerNotationDiff, |
| 5 | + transformerNotationHighlight, |
| 6 | + transformerNotationWordHighlight, |
| 7 | +} from "@shikijs/transformers"; |
| 8 | +import tailwindcss from "@tailwindcss/vite"; |
| 9 | +import { defineConfig } from "astro/config"; |
| 10 | +import remarkCollapse from "remark-collapse"; |
| 11 | +import remarkToc from "remark-toc"; |
| 12 | +import { loadEnv } from "vite"; |
| 13 | +import { transformerFileName } from "./src/utils/transformers/fileName"; |
| 14 | + |
| 15 | +// https://github.com/withastro/astro/issues/12667 |
| 16 | +// https://docs.astro.build/en/guides/environment-variables/#in-the-astro-config-file |
| 17 | +const env = loadEnv(process.env.NODE_ENV || "", process.cwd(), ""); |
| 18 | + |
| 19 | +// https://astro.build/config |
| 20 | +export default defineConfig({ |
| 21 | + site: env.PUBLIC_SITE_URL, |
| 22 | + integrations: [sitemap(), mdx()], |
| 23 | + devToolbar: { |
| 24 | + enabled: false, |
| 25 | + }, |
| 26 | + markdown: { |
| 27 | + remarkPlugins: [remarkToc, [remarkCollapse, { test: "Table of contents" }]], |
| 28 | + shikiConfig: { |
| 29 | + // For more themes, visit https://shiki.style/themes |
| 30 | + themes: { light: "min-light", dark: "night-owl" }, |
| 31 | + defaultColor: false, |
| 32 | + wrap: false, |
| 33 | + transformers: [ |
| 34 | + transformerFileName({ style: "v2", hideDot: false }), |
| 35 | + transformerNotationHighlight(), |
| 36 | + transformerNotationWordHighlight(), |
| 37 | + transformerNotationDiff({ matchAlgorithm: "v3" }), |
| 38 | + ], |
| 39 | + }, |
| 40 | + }, |
| 41 | + vite: { |
| 42 | + plugins: [ |
| 43 | + // https://github.com/withastro/astro/issues/14030 |
| 44 | + tailwindcss(), |
| 45 | + ], |
| 46 | + }, |
| 47 | +}); |
0 commit comments