Skip to content

Commit df37d7f

Browse files
sarah11918HiDeooainurxtrueberrylessyanthomasdev
authored
[i18nIgnore] New deploy guide navigation component (#12735)
@lunaria-track:src/content/docs/en/guides/deploy/aws-via-flightcontrol.mdx;src/content/docs/en/guides/deploy/aws-via-sst.mdx; src/content/docs/en/guides/deploy/firebase.mdx Co-authored-by: HiDeoo <494699+HiDeoo@users.noreply.github.com> Co-authored-by: ainurx_78 <34947605+ainurx@users.noreply.github.com> Co-authored-by: trueberryless <99918022+trueberryless@users.noreply.github.com> Co-authored-by: yanthomasdev <61414485+yanthomasdev@users.noreply.github.com> Co-authored-by: ArmandPhilippot <59021693+ArmandPhilippot@users.noreply.github.com>
1 parent 1f80026 commit df37d7f

File tree

153 files changed

+347
-80
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+347
-80
lines changed

public/_redirects

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
/:lang/reference/experimental-flags/svg/ /:lang/guides/images/
4040
/:lang/reference/experimental-flags/serialized-configuration/ /:lang/reference/modules/astro-config/
4141
/:lang/reference/experimental-flags/responsive-images/ /:lang/guides/images/
42+
/:lang/guides/deploy/sst/ /:lang/guides/deploy/aws-via-sst/
43+
/:lang/guides/deploy/flightcontrol/ /:lang/guides/deploy/aws-via-flightcontrol/
44+
/:lang/guides/deploy/google-firebase/ /:lang/guides/deploy/firebase/
4245

4346

4447
# Very old docs site redirects
Lines changed: 16 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
2+
import { englishPages } from '~/content';
23
import { getLanguageFromURL } from '~/util/path-utils';
4+
import { isDeployEntry } from '~/content.config';
35
import CardsNav from './NavGrid/CardsNav.astro';
4-
import type { LogoKey } from '~/data/logos';
56
67
export interface Props {
78
minimal?: boolean;
@@ -10,54 +11,20 @@ export interface Props {
1011
const { minimal } = Astro.props as Props;
1112
1213
const lang = getLanguageFromURL(Astro.url.pathname);
14+
const enPages = englishPages.filter(isDeployEntry);
1315
14-
interface Service {
15-
title: string;
16-
slug: LogoKey;
17-
supports: ['ssr', 'static'] | ['ssr'] | ['static'];
18-
}
19-
20-
const services: Service[] = [
21-
{ title: 'Netlify', slug: 'netlify', supports: ['ssr', 'static'] },
22-
{ title: 'Vercel', slug: 'vercel', supports: ['ssr', 'static'] },
23-
{ title: 'Deno Deploy', slug: 'deno', supports: ['ssr', 'static'] },
24-
{ title: 'GitHub Pages', slug: 'github', supports: ['static'] },
25-
{ title: 'GitLab Pages', slug: 'gitlab', supports: ['static'] },
26-
{ title: 'Cloudflare Pages', slug: 'cloudflare', supports: ['ssr', 'static'] },
27-
{ title: 'AWS', slug: 'aws', supports: ['ssr', 'static'] },
28-
{ title: 'AWS via Flightcontrol', slug: 'flightcontrol', supports: ['ssr', 'static'] },
29-
{ title: 'AWS via SST', slug: 'sst', supports: ['ssr', 'static'] },
30-
{ title: 'Clever Cloud', slug: 'clever-cloud', supports: ['ssr', 'static'] },
31-
{ title: 'Azion', slug: 'azion', supports: ['ssr', 'static'] },
32-
{ title: 'Google Cloud', slug: 'google-cloud', supports: ['ssr', 'static'] },
33-
{ title: 'Google Firebase', slug: 'google-firebase', supports: ['ssr', 'static'] },
34-
{ title: 'Heroku', slug: 'heroku', supports: ['static'] },
35-
{ title: 'Microsoft Azure', slug: 'microsoft-azure', supports: ['static'] },
36-
{ title: 'Buddy', slug: 'buddy', supports: ['static'] },
37-
{ title: 'DeployHQ', slug: 'deployhq', supports: ['static'] },
38-
{ title: 'Fleek', slug: 'fleek', supports: ['static'] },
39-
{ title: 'Fly.io', slug: 'flyio', supports: ['ssr', 'static'] },
40-
{ title: 'Juno', slug: 'juno', supports: ['static'] },
41-
{ title: 'Railway', slug: 'railway', supports: ['ssr', 'static'] },
42-
{ title: 'Render', slug: 'render', supports: ['static'] },
43-
{ title: 'Stormkit', slug: 'stormkit', supports: ['static'] },
44-
{ title: 'Surge', slug: 'surge', supports: ['static'] },
45-
{ title: 'Cleavr', slug: 'cleavr', supports: ['ssr', 'static'] },
46-
{ title: 'Kinsta', slug: 'kinsta', supports: ['ssr', 'static'] },
47-
{ title: 'Zeabur', slug: 'zeabur', supports: ['ssr', 'static'] },
48-
{ title: 'Zerops', slug: 'zerops', supports: ['ssr', 'static'] },
49-
{ title: 'CloudRay', slug: 'cloudray', supports: ['static'] },
50-
{ title: 'Seenode', slug: 'seenode', supports: ['ssr'] },
51-
{ title: 'Zephyr', slug: 'zephyr', supports: ['static'] },
52-
];
16+
const links = enPages
17+
// Sort alphabetically.
18+
.sort((a, b) => (a.id > b.id ? 1 : -1))
19+
.map((page) => {
20+
const { logo, sidebar, supports } = page.data;
21+
if (!sidebar.label) throw new Error('Deploy guides must always include a sidebar label.');
22+
const pageUrl = '/' + page.id.replace('en/', `${lang}/`) + '/';
23+
const tags = Object.fromEntries(supports.map((s) => [s, Astro.locals.t(`deploy.${s}Tag`)!]));
24+
return { title: sidebar.label, href: pageUrl, logo, tags };
25+
});
5326
---
5427

55-
<CardsNav
56-
minimal={minimal}
57-
links={services.map(({ title, slug, supports }) => ({
58-
title,
59-
href: `/${lang}/guides/deploy/${slug}/`,
60-
logo: slug,
61-
tags: Object.fromEntries(supports.map((s) => [s, Astro.locals.t(`deploy.${s}Tag`)!])),
62-
}))}
63-
/>
28+
<section>
29+
<CardsNav minimal={minimal} links={links} />
30+
</section>

src/content.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { docsSchema, i18nSchema } from '@astrojs/starlight/schema';
33
import { defineCollection, z, type CollectionEntry } from 'astro:content';
44
import { file } from 'astro/loaders';
55
import { AstroDocsI18nSchema } from './content/i18n-schema';
6+
import { logoKeys } from './data/logos';
67

78
export const baseSchema = z.object({
89
type: z.literal('base').optional().default('base'),
@@ -23,6 +24,8 @@ export const baseSchema = z.object({
2324

2425
export const deploySchema = baseSchema.extend({
2526
type: z.literal('deploy'),
27+
logo: z.enum(logoKeys),
28+
supports: z.array(z.enum(['static', 'ssr'])),
2629
});
2730

2831
export const backendSchema = baseSchema.extend({
@@ -121,6 +124,8 @@ export const isBackendEntry = createIsDocsEntry('backend');
121124

122125
export const isCmsEntry = createIsDocsEntry('cms');
123126

127+
export const isDeployEntry = createIsDocsEntry('deploy');
128+
124129
export const isIntegrationEntry = createIsDocsEntry('integration');
125130

126131
export const isTutorialEntry = createIsDocsEntry('tutorial');

src/content/docs/de/guides/deploy/flightcontrol.mdx renamed to src/content/docs/de/guides/deploy/aws-via-flightcontrol.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
title: Veröffentliche deine Astro-Website mit Flightcontrol auf AWS
33
description: Wie du deine Astro-Website mit Flightcontrol auf AWS veröffentlichst
44
sidebar:
5-
label: Flightcontrol
5+
label: AWS via Flightcontrol
66
type: deploy
7+
logo: flightcontrol
8+
supports: ['ssr', 'static']
79
i18nReady: true
810
---
911

src/content/docs/de/guides/deploy/buddy.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ description: Wie du deine Astro-Website mit Buddy im Internet veröffentlichst.
44
sidebar:
55
label: Buddy
66
type: deploy
7+
logo: buddy
8+
supports: ['static']
79
i18nReady: true
810
---
911

src/content/docs/de/guides/deploy/cleavr.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ description: Wie du deine Astro-Website mit Cleavr auf deinem VPS-Server bereits
44
sidebar:
55
label: Cleavr
66
type: deploy
7+
logo: cleavr
8+
supports: ['ssr', 'static']
79
i18nReady: true
810
---
911

src/content/docs/de/guides/deploy/deno.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
title: Veröffentliche deine Astro-Website auf Deno
33
description: Wie du deine Astro-Webseite mit Deno im Internet veröffentlichst.
44
sidebar:
5-
label: Deno
5+
label: Deno Deploy
66
type: deploy
7+
logo: deno
8+
supports: ['ssr', 'static']
79
i18nReady: true
810
---
911

src/content/docs/de/guides/deploy/google-firebase.mdx renamed to src/content/docs/de/guides/deploy/firebase.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
title: Veröffentliche deine Astro-Website auf Google's Firebase Hosting
33
description: Wie du deine Astro-Website auf Firebase-Hosting von Google im Internet veröffentlichst.
44
type: deploy
5+
logo: firebase
6+
supports: ['static', 'ssr']
7+
sidebar:
8+
label: Firebase
59
i18nReady: true
610
---
711

src/content/docs/de/guides/deploy/gitlab.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ description: Anleitung zur Veröffentlichung deiner Astro-Website mittels GitLab
44
sidebar:
55
label: GitLab Pages
66
type: deploy
7+
logo: gitlab
8+
supports: ['static']
79
i18nReady: true
810
---
911

src/content/docs/de/guides/deploy/google-cloud.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ description: Wie du deine Astro-Website auf Google Cloud im Internet veröffentl
44
sidebar:
55
label: Google Cloud
66
type: deploy
7+
logo: google-cloud
8+
supports: ['ssr', 'static']
79
i18nReady: true
810
---
911

0 commit comments

Comments
 (0)