11---
2+ import { englishPages } from ' ~/content' ;
23import { getLanguageFromURL } from ' ~/util/path-utils' ;
4+ import { isDeployEntry } from ' ~/content.config' ;
35import CardsNav from ' ./NavGrid/CardsNav.astro' ;
4- import type { LogoKey } from ' ~/data/logos' ;
56
67export interface Props {
78 minimal? : boolean ;
@@ -10,54 +11,20 @@ export interface Props {
1011const { minimal } = Astro .props as Props ;
1112
1213const 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 >
0 commit comments