-
Notifications
You must be signed in to change notification settings - Fork 0
/
astro.config.mjs
74 lines (72 loc) · 2.1 KB
/
astro.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import { defineConfig } from "astro/config";
import tailwind from "@astrojs/tailwind";
import icon from "astro-icon";
import sitemap from "@astrojs/sitemap";
import mdx from "@astrojs/mdx";
import react from "@astrojs/react";
import pagefind from "astro-pagefind";
import remarkHighLight from "./src/lib/remark-higlight.mjs";
import remarkExternalLink from "./src/lib/remark-external-links.mjs";
import remarkWikilinks from "./src/lib/remark-wikilinks.mjs";
const SITE_URL = process.env.SITE_URL || "http://localhost:4321";
const PUBLIC_REF_NAME = process.env.PUBLIC_REF_NAME
? process.env.PUBLIC_REF_NAME
: "";
if (PUBLIC_REF_NAME === "") {
throw new Error("PUBLIC_REF_NAME is empty");
}
console.log("🚀 ~ PUBLIC_REF_NAME:", PUBLIC_REF_NAME);
const PUBLIC_BASE = process.env.PUBLIC_BASE ? process.env.PUBLIC_BASE : "";
console.log("🚀 ~ PUBLIC_BASE:", PUBLIC_BASE || "empty 👌");
const tina = ({ directiveName = "tina" } = {}) => ({
name: "tina-cms",
hooks: {
"astro:config:setup": ({ addClientDirective, opts }) => {
addClientDirective({
name: directiveName,
entrypoint: "./tina/tina.mjs",
});
},
},
});
// https://astro.build/config
export default defineConfig({
site: SITE_URL,
base: PUBLIC_BASE,
build: {
format: "file",
},
// i18n: {
// defaultLocale: "fr",
// locales: ["en", "es", "fr"],
// routing: {
// prefixDefaultLocale: false,
// },
// },
markdown: {
// Applied to .md and .mdx files
remarkPlugins: [remarkHighLight, remarkExternalLink, remarkWikilinks],
// rehypePlugins: [rehypeAccessibleEmojis],
},
integrations: [
tailwind({
// Example: Disable injecting a basic `base.css` import on every page.
// Useful if you need to define and/or import your own custom `base.css`.
applyBaseStyles: false,
// Example: Allow writing nested CSS declarations
// alongside Tailwind's syntax
nesting: true,
}),
tina(),
icon({
iconDir: "src/assets/icons",
include: {
tabler: ["*"],
},
}),
sitemap(),
mdx(),
react(),
pagefind(),
],
});