-
Notifications
You must be signed in to change notification settings - Fork 426
Expand file tree
/
Copy pathastro.config.ts
More file actions
124 lines (116 loc) · 3.72 KB
/
Copy pathastro.config.ts
File metadata and controls
124 lines (116 loc) · 3.72 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// @ts-check
import starlight from "@astrojs/starlight";
import { defineConfig, fontProviders } from "astro/config";
import { satteriRelativeMarkdownLinks } from "@system76/satteri-relative-markdown-links";
import { satteri } from "@astrojs/markdown-satteri";
import icon from "astro-icon";
import googleAnalytics from "./src/plugins/googleAnalytics.ts"
const base = "support";
const buildEnv = process.env.BUILD_ENV ?? "local";
const siteByBuildEnv = {
local: `http://localhost:4321/${base}`,
staging: `https://genesis76.com/${base}`,
production: `https://system76.com/${base}`,
};
const site = siteByBuildEnv[buildEnv as keyof typeof siteByBuildEnv];
if (!(buildEnv in siteByBuildEnv)) {
throw new Error(
`Invalid BUILD_ENV "${buildEnv}", expected one of: ${Object.keys(siteByBuildEnv).join(", ")}`,
);
}
// https://astro.build/config
export default defineConfig({
integrations: [
starlight({
title: "System76 Support Documentation",
logo: {
light: "./src/assets/img/system76_logo-light.svg",
dark: "./src/assets/img/system76_logo-dark.svg",
replacesTitle: true,
alt: "System76 Logo"
},
lastUpdated: true,
routeMiddleware: "./src/plugins/sidebarMiddleware.ts",
components: {
Head: "./src/components/Head.astro",
PageTitle: "./src/components/PageTitle.astro",
ContentPanel: "./src/components/ContentPanel.astro",
Search: "./src/components/Search.astro",
},
customCss: [
"./src/assets/css/icons.css",
"./src/assets/css/variables.css"
],
favicon: "/favicon.png",
social: [
{
icon: "x.com",
label: "Twitter",
href: "https://x.com/system76",
},
{
icon: "linkedin",
label: "LinkedIn",
href: "https://www.linkedin.com/company/system76",
},
{
icon: "reddit",
label: "reddit",
href: "https://www.reddit.com/r/System76/",
},
{
icon: "github",
label: "GitHub",
href: "https://github.com/system76",
},
],
head: [...googleAnalytics(buildEnv)],
}),
icon(),
],
base,
site,
fonts: [
{
provider: fontProviders.fontsource(),
name: "Fira Sans",
cssVariable: "--font-fira-sans",
weights: [400, 700],
styles: ["normal"],
subsets: ["latin"],
},
{
provider: fontProviders.fontsource(),
name: "Roboto Slab",
cssVariable: "--font-roboto-slab",
weights: [400, 700],
styles: ["normal"],
subsets: ["latin"],
},
{
provider: fontProviders.fontsource(),
name: "Ubuntu Mono",
cssVariable: "--font-ubuntu-mono",
weights: [400],
styles: ["normal"],
subsets: ["latin"],
},
],
image: {
// service: {
// entrypoint: "./src/avifImageService.mjs",
// },
layout: "constrained",
responsiveStyles: true,
},
markdown: {
processor: satteri({
mdastPlugins: [
satteriRelativeMarkdownLinks({
base,
collectionBase: false,
}),
],
}),
},
});