forked from withastro/starlight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathastro.config.mjs
175 lines (171 loc) · 4.67 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
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
import starlightLinksValidator from 'starlight-links-validator';
export const locales = {
root: { label: 'English', lang: 'en' },
de: { label: 'Deutsch', lang: 'de' },
es: { label: 'Español', lang: 'es' },
ja: { label: '日本語', lang: 'ja' },
fr: { label: 'Français', lang: 'fr' },
it: { label: 'Italiano', lang: 'it' },
id: { label: 'Bahasa Indonesia', lang: 'id' },
'zh-cn': { label: '简体中文', lang: 'zh-CN' },
'pt-br': { label: 'Português do Brasil', lang: 'pt-BR' },
'pt-pt': { label: 'Português', lang: 'pt-PT' },
ko: { label: '한국어', lang: 'ko' },
tr: { label: 'Türkçe', lang: 'tr' },
ru: { label: 'Русский', lang: 'ru' },
hi: { label: 'हिंदी', lang: 'hi' },
da: { label: 'Dansk', lang: 'da' },
uk: { label: 'Українська', lang: 'uk' },
};
/* https://docs.netlify.com/configure-builds/environment-variables/#read-only-variables */
const NETLIFY_PREVIEW_SITE = process.env.CONTEXT !== 'production' && process.env.DEPLOY_PRIME_URL;
const site = NETLIFY_PREVIEW_SITE || 'https://starlight.astro.build/';
const ogUrl = new URL('og.jpg?v=1', site).href;
export default defineConfig({
site,
trailingSlash: 'always',
integrations: [
starlight({
title: 'Starlight',
logo: {
light: '/src/assets/logo-light.svg',
dark: '/src/assets/logo-dark.svg',
replacesTitle: true,
},
editLink: {
baseUrl: 'https://github.com/withastro/starlight/edit/main/docs/',
},
social: {
github: 'https://github.com/withastro/starlight',
discord: 'https://astro.build/chat',
},
head: [
{
tag: 'script',
attrs: {
src: 'https://cdn.usefathom.com/script.js',
'data-site': 'EZBHTSIG',
defer: true,
},
},
{
tag: 'meta',
attrs: { property: 'og:image', content: ogUrl },
},
{
tag: 'meta',
attrs: { property: 'twitter:image', content: ogUrl },
},
],
customCss: process.env.NO_GRADIENTS ? [] : ['./src/assets/landing.css'],
locales,
sidebar: [
{
label: 'Start Here',
translations: {
de: 'Beginne hier',
es: 'Comienza aqui',
ja: 'ここからはじめる',
fr: 'Commencez ici',
it: 'Inizia qui',
id: 'Mulai dari sini',
'zh-CN': '从这里开始',
'pt-BR': 'Comece Aqui',
'pt-PT': 'Comece Aqui',
ko: '여기서부터',
tr: 'Buradan Başlayın',
ru: 'Первые шаги',
hi: 'यहाँ से शुरू करे',
uk: 'Почніть звідси',
},
items: [
'getting-started',
'manual-setup',
{
label: 'Environmental Impact',
slug: 'environmental-impact',
translations: {
de: 'Umweltbelastung',
es: 'Documentación ecológica',
ja: '環境への負荷',
fr: 'Impact environnemental',
it: 'Impatto ambientale',
id: 'Dampak terhadap lingkungan',
'zh-CN': '环境影响',
'pt-BR': 'Impacto Ambiental',
'pt-PT': 'Impacto Ambiental',
ko: '환경적 영향',
tr: 'Çevre Etkisi',
ru: 'Влияние на окружающую среду',
hi: 'पर्यावरणीय प्रभाव',
uk: 'Вплив на довкілля',
},
},
],
},
{
label: 'Guides',
translations: {
de: 'Anleitungen',
es: 'Guías',
ja: 'ガイド',
fr: 'Guides',
it: 'Guide',
id: 'Panduan',
'zh-CN': '指南',
'pt-BR': 'Guias',
'pt-PT': 'Guias',
ko: '가이드',
tr: 'Rehber',
ru: 'Руководства',
hi: 'गाइड',
uk: 'Ґайди',
},
autogenerate: { directory: 'guides' },
},
{
label: 'Reference',
translations: {
de: 'Referenz',
es: 'Referencias',
ja: 'リファレンス',
fr: 'Référence',
it: 'Riferimenti',
id: 'Referensi',
'zh-CN': '参考',
'pt-BR': 'Referência',
ko: '참조',
tr: 'Referanslar',
ru: 'Справочник',
hi: 'संदर्भ',
uk: 'Довідник',
},
autogenerate: { directory: 'reference' },
},
{
label: 'Resources',
badge: 'New',
translations: {
'zh-CN': '资源',
fr: 'Ressources',
'pt-BR': 'Recursos',
'pt-PT': 'Recursos',
ja: 'リソース',
ru: 'Ресурсы',
},
autogenerate: { directory: 'resources' },
},
],
plugins: process.env.CHECK_LINKS
? [
starlightLinksValidator({
errorOnFallbackPages: false,
errorOnInconsistentLocale: true,
}),
]
: [],
}),
],
});