Repository navigation
Expand file tree
/
Copy pathastro.config.mjs
More file actions
133 lines (130 loc) · 4.47 KB
/
Copy pathastro.config.mjs
File metadata and controls
133 lines (130 loc) · 4.47 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
125
126
127
128
129
130
131
132
133
// @ts-check
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";
import starlightGitHubAlerts from "starlight-github-alerts";
import starlightChangelogs, { makeChangelogsSidebarLinks } from "starlight-changelogs";
import starlightLinksValidator from "starlight-links-validator";
import { unified } from "@astrojs/markdown-remark";
import remarkAutoImportPolicyComponents from "./src/plugins/auto-import-policy-components.mjs";
import remarkInjectOmaUri from "./src/plugins/inject-oma-uri.mjs";
export const locales = {
root: { label: "English", lang: "en" },
// fr: { label: "Français", lang: "fr" },
};
// https://astro.build/config
export default defineConfig({
output: "static",
trailingSlash: "always",
redirects: {
"/reference/policies/certificates--install/": "/reference/policies/certificates/",
"/reference/policies/certificates--importenterpriseroots/": "/reference/policies/certificates/",
"/reference/policies/sanitizeonshutdown-all/": "/reference/policies/sanitizeonshutdown/",
"/reference/policies/sanitizeonshutdown-selective/": "/reference/policies/sanitizeonshutdown/",
"/reference/policies/searchengines--add/": "/reference/policies/searchengines/",
"/reference/policies/searchengines--default/": "/reference/policies/searchengines/",
"/reference/policies/searchengines--preventinstalls/": "/reference/policies/searchengines/",
"/reference/policies/searchengines--remove/": "/reference/policies/searchengines/",
"/reference/policies/securitydevices--deprecated/": "/reference/policies/securitydevices/",
"/reference/policies/disablepocket_deprecated_/": "/reference/policies/disablepocket/",
"/changelog/": "/release-notes/",
},
devToolbar: {
enabled: false,
},
// Don't render `"` as smart quotes:
markdown: {
processor: unified({
smartypants: false,
remarkPlugins: [remarkAutoImportPolicyComponents, remarkInjectOmaUri],
}),
},
integrations: [
starlight({
components: {
PageTitle: "./src/components/PageTitleWithBreadcrumbs.astro",
},
customCss: [
// Relative path to a custom CSS file
"./src/styles/custom.css",
"./src/fonts/font-face.css",
],
// editLink: {
// baseUrl: "https://github.com/mozilla/enterprise-admin-reference/edit/main/",
// },
expressiveCode: {
styleOverrides: { borderRadius: "0.2rem" },
shiki: {
// Allow using the alias 'url' for plaintext lang
langAlias: {
url: "plaintext",
},
},
},
favicon: "/favicon.png",
// Google tag (gtag.js) only in prod, so `astro dev` doesn't
// report localhost pageviews.
head: import.meta.env.PROD
? [
{
tag: "script",
attrs: {
async: true,
src: "https://www.googletagmanager.com/gtag/js?id=G-LMXJXH34WG",
},
},
{
tag: "script",
content: `window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-LMXJXH34WG');`,
},
]
: [],
lastUpdated: true,
plugins: [starlightGitHubAlerts(), starlightChangelogs(), starlightLinksValidator()],
// Gives each generated release note page its own title.
routeMiddleware: "./src/starlightRouteData.ts",
sidebar: [
{
label: "Reference",
items: [{ autogenerate: { directory: "reference", collapsed: true } }],
},
{
label: "Guides",
items: [{ autogenerate: { directory: "guides" } }],
},
{
label: "Resources",
items: [{ label: "Support", slug: "support" }],
},
{
label: "Release notes",
items: [
...makeChangelogsSidebarLinks([
{
type: "all",
base: "release-notes",
label: "All releases",
},
{
type: "recent",
base: "release-notes",
count: 6,
},
]),
],
},
],
social: [
{
icon: "github",
label: "GitHub",
href: "https://github.com/mozilla/enterprise-admin-reference",
},
],
title: "Firefox administrator reference",
}),
],
site: "https://firefox-admin-docs.mozilla.org",
});