-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
nav.ts
190 lines (177 loc) · 8.02 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
/**
* 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: 'Welcome, World!', header: true, type: 'learn', key: 'welcomeWorld' },
{ text: 'Getting Started', slug: 'getting-started', key: 'getting-started' },
{ text: 'Installation and Setup', slug: 'install-and-setup', key: 'install-and-setup' },
{ text: 'Deploy Your Site', slug: 'guides/deploy', key: 'guides/deploy' },
{ text: 'Migrate to Astro', slug: 'guides/migrate-to-astro', key: 'guides/migrate-to-astro' },
{ text: 'Tutorial: Build a Blog', slug: 'tutorial/0-introduction', key: 'blog-tutorial' },
{ 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: 'Learn the 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: 'Imports', slug: 'guides/imports', key: 'guides/imports' },
{ text: 'Integrations', slug: 'guides/integrations-guide', key: 'guides/integrations-guide' },
{ text: 'Manage Your Content', header: true, type: 'learn', key: 'content' },
{ text: 'Authoring Content', slug: 'guides/content', key: 'guides/content' },
{ text: 'Markdown', slug: 'guides/markdown-content', key: 'guides/markdown-content' },
{
text: 'Content Collections',
slug: 'guides/content-collections',
key: 'guides/content-collections',
},
{ text: 'Connect a CMS', slug: 'guides/cms', key: 'guides/cms' },
{ text: 'Add an RSS feed', slug: 'guides/rss', key: 'guides/rss' },
{ text: 'Routes and Navigation', header: true, type: 'learn', key: 'routes' },
{ text: 'Routing', slug: 'guides/routing', key: 'guides/routing' },
{ text: 'Endpoints', slug: 'guides/endpoints', key: 'guides/endpoints' },
{ text: 'Actions', slug: 'guides/actions', key: 'guides/actions' },
{ text: 'Prefetch', slug: 'guides/prefetch', key: 'guides/prefetch' },
{ text: 'Middleware', slug: 'guides/middleware', key: 'guides/middleware' },
{
text: 'Internationalization',
slug: 'guides/internationalization',
key: 'guides/internationalization',
},
{ text: 'View Transitions', slug: 'guides/view-transitions', key: 'guides/view-transitions' },
{ text: 'Assets', header: true, type: 'learn', key: 'assets' },
{ 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: 'Connect Hosted Media or DAM', slug: 'guides/media', key: 'guides/media' },
{ text: 'Connect Your Data', header: true, type: 'learn', key: 'data' },
{ text: 'Data Fetching', slug: 'guides/data-fetching', key: 'guides/data-fetching' },
{ text: 'Astro DB', slug: 'guides/astro-db', key: 'guides/astro-db' },
{ text: 'Add Backend Services', slug: 'guides/backend', key: 'guides/backend' },
{ text: 'E-commerce', slug: 'guides/ecommerce', key: 'guides/ecommerce' },
{ text: 'Authentication', slug: 'guides/authentication', key: 'guides/authentication' },
{
text: 'Environment Variables',
slug: 'guides/environment-variables',
key: 'guides/environment-variables',
},
{ text: 'Client-Side Interactivity', header: true, type: 'learn', key: 'clientSide' },
{
text: 'UI Frameworks',
slug: 'guides/framework-components',
key: 'guides/framework-components',
},
{
text: 'Scripts & Event Handling',
slug: 'guides/client-side-scripts',
key: 'guides/client-side-scripts',
},
{ text: 'Maintain Your Project', header: true, type: 'learn', key: 'maintain' },
{ text: 'Upgrade Astro', slug: 'upgrade-astro', key: 'upgrade-astro' },
{ text: 'Testing', slug: 'guides/testing', key: 'guides/testing' },
{ text: 'Troubleshooting', slug: 'guides/troubleshooting', key: 'guides/troubleshooting' },
{ text: 'Reference', header: true, type: 'api', key: 'reference' },
{
text: 'Configuration',
slug: 'reference/configuration-reference',
key: 'reference/configuration-reference',
},
{ text: 'Astro Runtime API', slug: 'reference/api-reference', key: 'reference/api-reference' },
{ text: 'Astro CLI', slug: 'reference/cli-reference', key: 'reference/cli-reference' },
{
text: 'Directives Reference',
slug: 'reference/directives-reference',
key: 'reference/directives-reference',
},
{ text: 'TypeScript Reference', slug: 'guides/typescript', key: 'guides/typescript' },
{ text: 'Error Reference', slug: 'reference/error-reference', key: 'reference/error-reference' },
{ text: 'Other Development APIs', header: true, type: 'api', key: 'dev' },
{
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 (Experimental)',
slug: 'reference/container-reference',
key: 'reference/container-reference',
},
{ 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',
},
// { 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',
// },
] 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;
}
);