Repository navigation
Expand file tree
/
Copy pathastro.config.mjs
More file actions
112 lines (107 loc) · 3.59 KB
/
Copy pathastro.config.mjs
File metadata and controls
112 lines (107 loc) · 3.59 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
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
import starlightLinksValidator from 'starlight-links-validator';
// In CI, only the `main` branch is production. Any other build (a PR, or a
// push to some other branch) is deployed as a Cloudflare Worker preview at
// "<branch>.previews.contribute.docs.astro.build" (see .github/workflows/deploy.yml).
const branch = process.env.GITHUB_HEAD_REF || process.env.GITHUB_REF_NAME;
const isMain = branch === 'main';
const site = !isMain && branch
? `https://${branch}.previews.contribute.docs.astro.build/`
: 'https://contribute.docs.astro.build/';
// https://astro.build/config
export default defineConfig({
site,
integrations: [
starlight({
plugins: [starlightLinksValidator()],
title: 'Astro Docs Docs (AD²)',
social: [
{ icon: 'github', label: 'GitHub', href: 'https://github.com/withastro/contribute.docs.astro.build' },
],
editLink: {
baseUrl: 'https://github.com/withastro/contribute.docs.astro.build/edit/main/'
},
customCss: ["./src/styles/theme.css"],
routeMiddleware: './src/routeData.ts',
logo: {
dark: './src/assets/logo-dark.svg',
light: './src/assets/logo-light.svg',
replacesTitle: true,
},
head: [
{
tag: 'script',
attrs: {
src: 'https://cdn.usefathom.com/script.js',
'data-site': 'EZBHTSIG',
defer: true,
},
},
],
sidebar: [
{ label: 'Welcome', link: '/welcome/' },
{
label: "About Doc'ing",
items: [
{ label: 'Why we write docs', link: '/about-docs/why-we-doc/' },
{ label: 'How we write docs', link: '/about-docs/how-we-doc/' },
],
},
{
label: 'First-time Contributors',
items: [
'first-time/about',
'first-time/good-first-contributions',
'first-time/file-an-issue',
'first-time/edit-single-page',
'first-time/larger-contributions',
'first-time/source-content',
'first-time/creating-pull-requests',
'first-time/pr-review-process',
],
},
{
label: 'Docs Syntax Reference',
autogenerate: { directory: 'reference' },
},
{
label: 'Documenting Code Changes',
items: [
{ label: 'About documenting changes', link: '/docs-for-code-changes/about-documenting-code-changes/' },
{ label: 'Patch changes', link: '/docs-for-code-changes/patch-changes/' },
{ label: 'New or updated features', link: '/docs-for-code-changes/new-feature-docs/' },
{ label: 'Experimental features', link: '/docs-for-code-changes/experimental-feature-docs/' },
{ label: 'Error messages', link: '/docs-for-code-changes/error-reference/' },
{ label: 'Changesets', link: '/docs-for-code-changes/changesets/' },
],
},
{
label: 'Contributing Guides',
items: [
{ label: 'Writing and Style Guide', link: '/guides/writing-style/' },
{ label: 'Adding a new Astro + X Guide', link: '/guides/new-third-party-guide/' },
{ label: 'Contributing a Recipe', link: '/guides/recipe-writing/' },
{ label: 'Translating Astro docs', link: '/guides/i18n/' },
{ label: 'Contributing for Hacktoberfest', link: '/guides/hacktoberfest/' },
],
},
{
label: 'Major Upgrade guides',
items: [
{ label: 'About Astro upgrade guides', link: '/upgrade-guides/about/' },
{ label: 'Breaking changes', link: '/upgrade-guides/breaking-changes/' },
],
},
{
label: 'Roles',
autogenerate: { directory: 'roles' },
},
{
label: 'Reviewers',
autogenerate: { directory: 'reviewers' },
},
],
}),
],
});