-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathastro.config.mts
246 lines (243 loc) · 7.03 KB
/
astro.config.mts
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
import starlight from '@astrojs/starlight';
import ui from '@studiocms/ui';
import { defineConfig } from 'astro/config';
import starlightImageZoom from 'starlight-image-zoom';
import starlightSidebarTopics from 'starlight-sidebar-topics';
import getCoolifyURL from './hostUtils.ts';
import rehypePlugins from './src/plugins/rehypePluginKit.ts';
import { typeDocPlugins } from './typedoc.config.ts';
import { getTranslations } from './starlight-sidebar/translate.ts';
import { devServerFileWatcher } from './src/integrations/dev-file-watcher.ts';
import { remarkFallbackLang } from './src/plugins/remark-fallback-pages.ts';
// Define the Site URL
const site = getCoolifyURL(true) || 'https://docs.studiocms.dev/';
export const locales = {
en: { label: 'English', lang: 'en' },
es: { label: 'Español', lang: 'es' },
// de: { label: 'Deutsch', lang: 'de' },
// 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' },
};
export default defineConfig({
site,
image: {
remotePatterns: [{ protocol: 'https' }],
},
markdown: {
rehypePlugins,
remarkPlugins: [remarkFallbackLang()],
},
trailingSlash: 'always',
integrations: [
devServerFileWatcher([
'./hostUtils.ts',
'./typedoc.config.ts',
'./starlight-types.ts',
'./starlight-sidebar/*',
'./src/content.ts',
'./src/share-link.ts',
'./src/util/*.ts',
'./src/plugins/*.{ts,js}',
'./src/integrations/*.ts',
]),
ui(),
starlight({
title: 'StudioCMS',
description: 'A dedicated CMS for Astro DB. Built from the ground up by the Astro community.',
favicon: '/logo-light.svg',
lastUpdated: true,
credits: true,
tagline: 'A dedicated CMS for Astro DB. Built from the ground up by the Astro community.',
disable404Route: true,
pagefind: false,
components: {
SiteTitle: './src/starlightOverrides/SiteTitle.astro',
PageTitle: './src/starlightOverrides/PageTitle.astro',
Sidebar: './src/starlightOverrides/Sidebar.astro',
Head: './src/starlightOverrides/Head.astro',
Search: './src/starlightOverrides/Search.astro',
},
logo: {
dark: './assets/logo-light.svg',
light: './assets/logo-dark.svg',
},
defaultLocale: 'en',
locales,
social: {
github: 'https://github.com/withstudiocms/studiocms',
discord: 'https://chat.studiocms.dev',
youtube: 'https://www.youtube.com/@StudioCMS',
'x.com': 'https://x.com/withstudiocms',
blueSky: 'https://bsky.app/profile/studiocms.dev',
openCollective: 'https://opencollective.com/StudioCMS',
},
customCss: [
'@studiocms/ui/css/global.css',
'./src/styles/sponsorcolors.css',
'./src/styles/starlight.css',
],
editLink: {
baseUrl: 'https://github.com/withstudiocms/docs/tree/main',
},
head: [
{
tag: 'script',
attrs: {
src: 'https://analytics.studiocms.dev/script.js',
'data-website-id': 'e924da68-f547-4dd2-bd2f-bcdd78cbcdab',
defer: true,
},
},
{
tag: 'meta',
attrs: {
name: 'og:image',
content: `${site}og.png`,
},
},
{
tag: 'meta',
attrs: {
name: 'twitter:image',
content: `${site}og.png`,
},
},
{
tag: 'meta',
attrs: {
name: 'twitter:site',
content: 'withstudiocms',
},
},
{
tag: 'meta',
attrs: {
name: 'twitter:creator',
content: 'withstudiocms',
},
},
],
plugins: [
...typeDocPlugins,
starlightImageZoom(),
starlightSidebarTopics([
{
label: getTranslations('topic-learn'),
link: '/start-here/getting-started',
icon: 'open-book',
id: 'learn',
items: [
{
label: getTranslations('start-here').en,
translations: getTranslations('start-here'),
autogenerate: { directory: 'start-here' },
},
{
label: getTranslations('contributing').en,
translations: getTranslations('contributing'),
autogenerate: { directory: 'contributing' },
},
{
label: getTranslations('how-it-works').en,
translations: getTranslations('how-it-works'),
autogenerate: { directory: 'how-it-works' },
},
{
label: getTranslations('utils').en,
translations: getTranslations('utils'),
autogenerate: { directory: 'utils' },
},
{
label: getTranslations('plugins').en,
translations: getTranslations('plugins'),
autogenerate: { directory: 'plugins' },
},
],
},
{
label: getTranslations('topic-package-catalog'),
link: '/package-catalog',
icon: 'download',
id: 'package-catalog',
items: [
{
label: getTranslations('catalog').en,
translations: getTranslations('catalog'),
link: '/package-catalog',
},
{
label: getTranslations('studiocms-plugins').en,
translations: getTranslations('studiocms-plugins'),
autogenerate: { directory: 'package-catalog/studiocms-plugins' },
},
{
label: getTranslations('community-plugins').en,
translations: getTranslations('community-plugins'),
autogenerate: { directory: 'package-catalog/community-plugins' },
},
],
},
{
label: getTranslations('topic-references'),
link: '/config-reference',
icon: 'information',
id: 'references',
items: [
{
label: getTranslations('config-reference').en,
translations: getTranslations('config-reference'),
autogenerate: { directory: 'config-reference' },
},
{
label: getTranslations('typedoc').en,
translations: getTranslations('typedoc'),
badge: {
text: getTranslations('auto-gen'),
variant: 'tip',
},
items: [
{
label: 'studiocms',
autogenerate: { directory: 'typedoc/studiocms' },
collapsed: true,
},
{
label: '@studiocms/blog',
autogenerate: { directory: 'typedoc/studiocms-blog' },
collapsed: true,
},
{
label: '@studiocms/devapps',
autogenerate: { directory: 'typedoc/studiocms-devapps' },
collapsed: true,
},
{
label: '@studiocms/markdoc',
autogenerate: { directory: 'typedoc/studiocms-markdoc' },
collapsed: true,
},
{
label: '@studiocms/mdx',
autogenerate: { directory: 'typedoc/studiocms-mdx' },
collapsed: true,
},
],
},
],
},
]),
],
}),
],
});