-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathnav.ts
235 lines (222 loc) · 8.13 KB
/
nav.ts
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
/**
* This configures the navigation sidebar.
* All other languages follow this ordering/structure and will fall back to
* English for any entries they haven’t translated.
*
* - All entries MUST include `text` and `key`
* - The first entry MUST be a heading
* - Heading entries MUST include `header: true` and `type`
* - Heading entries MAY include `nested: true` to move that heading and following links under the previous unnested heading
* - Heading entries MAY include `collapsed: true` to mark it and its children as collapsed by default
* - Link entries MUST include `slug` (which excludes the language code)
*
* For translators:
*
* Copy the English `key` value unchanged and translate only the `text` into your language:
*
* `src/i18n/en/nav.ts`: `{ text: 'Getting Started', slug: 'getting-started', key: 'getting-started' },`
* `src/i18n/ja/nav.ts`: `'getting-started': 'はじめに',`
*/
export default [
{ text: 'Start Here', header: true, type: 'learn', key: 'startHere' },
{ text: 'Getting Started', slug: 'getting-started', key: 'getting-started' },
{ text: 'Installation', slug: 'install/auto', key: 'install' },
{ text: 'Editor Setup', slug: 'editor-setup', key: 'editor-setup' },
{ text: 'Upgrade Astro', slug: 'upgrade-astro', key: 'upgrade-astro' },
{ text: 'Core Concepts', header: true, type: 'learn', key: 'coreConcepts' },
{ text: 'Why Astro', slug: 'concepts/why-astro', key: 'concepts/why-astro' },
{ text: 'Astro Islands', slug: 'concepts/islands', key: 'concepts/islands' },
{ text: 'Tutorials', header: true, type: 'learn', key: 'tutorials' },
{ text: 'Build a Blog', slug: 'tutorial/0-introduction', key: 'blog-tutorial' },
{
text: 'Extend with Content Collections',
slug: 'tutorials/add-content-collections',
key: 'add-collections-tutorial',
},
{
text: 'Extend with View Transitions',
slug: 'tutorials/add-view-transitions',
key: 'add-transitions-tutorial',
},
// { text: 'Thinking with Islands', slug: 'tutorial/0-introduction', key: 'island-tutorial' },
{ text: 'Basics', header: true, type: 'learn', key: 'basics' },
{
text: 'Project Structure',
slug: 'basics/project-structure',
key: 'basics/project-structure',
},
{
text: 'Components',
slug: 'basics/astro-components',
key: 'basics/astro-components',
},
{ text: 'Pages', slug: 'basics/astro-pages', key: 'basics/astro-pages' },
{ text: 'Layouts', slug: 'basics/layouts', key: 'basics/layouts' },
{
text: 'Astro Template Syntax',
slug: 'basics/astro-syntax',
key: 'basics/astro-syntax',
},
{
text: 'Rendering Modes',
slug: 'basics/rendering-modes',
key: 'basics/rendering-modes',
},
{ text: 'Built-ins', header: true, type: 'learn', key: 'builtins' },
{
text: 'Content Collections',
slug: 'guides/content-collections',
key: 'guides/content-collections',
},
{
text: 'View Transitions',
slug: 'guides/view-transitions',
key: 'guides/view-transitions',
},
{
text: 'Prefetch',
slug: 'guides/prefetch',
key: 'guides/prefetch',
},
{
text: 'Dev Toolbar',
slug: 'guides/dev-toolbar',
key: 'guides/dev-toolbar',
},
{ text: 'Integrations', header: true, type: 'learn', key: 'addons' },
{ text: 'Add integrations', slug: 'guides/integrations-guide', key: 'guides/integrations-guide' },
{
text: 'UI Frameworks',
slug: 'guides/framework-components',
key: 'guides/framework-components',
},
{
text: 'SSR Adapters',
slug: 'guides/server-side-rendering',
key: 'guides/server-side-rendering',
},
{
text: 'Astro DB',
slug: 'guides/astro-db',
key: 'guides/astro-db',
},
{ text: 'Recipes', header: true, type: 'learn', key: 'examples' },
{ text: 'Migrate to Astro', slug: 'guides/migrate-to-astro', key: 'guides/migrate-to-astro' },
{ text: 'Connect to Astro Studio', slug: 'recipes/studio', key: 'recipes/studio' },
{ text: 'Connect a CMS', slug: 'guides/cms', key: 'guides/cms' },
{ text: 'Add backend services', slug: 'guides/backend', key: 'guides/backend' },
{ text: 'Deploy your site', slug: 'guides/deploy', key: 'guides/deploy' },
{ text: 'More recipes', slug: 'recipes', key: 'guides/recipes' },
{ text: 'Guides', header: true, type: 'learn', key: 'features' },
{ text: 'Routing', slug: 'guides/routing', key: 'guides/routing' },
{ text: 'Markdown', slug: 'guides/markdown-content', key: 'guides/markdown-content' },
{
text: 'Scripts & Event Handling',
slug: 'guides/client-side-scripts',
key: 'guides/client-side-scripts',
},
{ text: 'CSS & Styling', slug: 'guides/styling', key: 'guides/styling' },
{ text: 'Images', slug: 'guides/images', key: 'guides/images' },
{ text: 'Fonts', slug: 'guides/fonts', key: 'guides/fonts' },
{ text: 'Imports', slug: 'guides/imports', key: 'guides/imports' },
{ text: 'Endpoints', slug: 'guides/endpoints', key: 'guides/endpoints' },
{ text: 'Data Fetching', slug: 'guides/data-fetching', key: 'guides/data-fetching' },
{
text: 'Internationalization',
slug: 'guides/internationalization',
key: 'guides/internationalization',
},
{ text: 'Middleware', slug: 'guides/middleware', key: 'guides/middleware' },
{ text: 'E-commerce', slug: 'guides/ecommerce', key: 'guides/ecommerce' },
{ text: 'Testing', slug: 'guides/testing', key: 'guides/testing' },
{ text: 'Authentication', slug: 'guides/authentication', key: 'guides/authentication' },
{ text: 'Troubleshooting', slug: 'guides/troubleshooting', key: 'guides/troubleshooting' },
{ text: 'Configuration', header: true, type: 'learn', key: 'configuration' },
{
text: 'The Astro Config File',
slug: 'guides/configuring-astro',
key: 'guides/configuring-astro',
},
{ text: 'TypeScript', slug: 'guides/typescript', key: 'guides/typescript' },
{ text: 'Import Aliases', slug: 'guides/aliases', key: 'guides/aliases' },
{
text: 'Environment Variables',
slug: 'guides/environment-variables',
key: 'guides/environment-variables',
},
{ text: 'Reference', header: true, type: 'api', key: 'reference' },
{
text: 'Configuration',
slug: 'reference/configuration-reference',
key: 'reference/configuration-reference',
},
{ text: 'Runtime API', slug: 'reference/api-reference', key: 'reference/api-reference' },
{
text: 'Integrations API',
slug: 'reference/integrations-reference',
key: 'reference/integrations-reference',
},
{ text: 'Adapter API', slug: 'reference/adapter-reference', key: 'reference/adapter-reference' },
{
text: 'Image Service API',
slug: 'reference/image-service-reference',
key: 'reference/image-service-reference',
},
{
text: 'Dev Toolbar App API',
slug: 'reference/dev-toolbar-app-reference',
key: 'reference/dev-toolbar-app-reference',
},
{
text: 'Container API',
slug: 'reference/container-reference',
key: 'reference/container-reference',
},
{
text: 'Template Directives',
slug: 'reference/directives-reference',
key: 'reference/directives-reference',
},
{ text: 'The Astro CLI', slug: 'reference/cli-reference', key: 'reference/cli-reference' },
{
text: 'Error Reference',
slug: 'reference/error-reference',
key: 'reference/error-reference',
},
{ text: 'NPM Package Format', slug: 'reference/publish-to-npm', key: 'guides/publish-to-npm' },
{ text: 'Community Resources', header: true, type: 'learn', key: 'communityResources' },
{
text: 'Courses, Guides, and Recipes',
slug: 'community-resources/content',
key: 'community-resources/content',
},
{
text: 'Talks, Interviews, and Streams',
slug: 'community-resources/talks',
key: 'community-resources/talks',
},
] satisfies NavEntry[];
type NavEntry = {
/** The visible label for this link or heading. */
text: string;
/**
* A unique key for this entry. Used in translation files to provide a translation for this entry’s label.
* Often the same as `slug` for links (but doesn’t have to be).
*/
key: string;
} & (
| {
/** The content collection slug for this page *without* the language code. */
slug: string;
}
| {
/** Marks this entry as a group heading and starts a new group. */
header: true;
/** Whether this group is in the learn or API category (currently unused). */
type: 'learn' | 'api';
/** Whether this group should be nested inside the preceding group. */
nested?: boolean;
/** Whether this group should be collapsed by default. */
collapsed?: boolean;
}
);