mirror of
https://github.com/cloudflare/vinext.git
synced 2026-09-14 19:04:59 +08:00
c1a78a73d8
* fix(build): support trailing-slash static exports * fix(ci): initialize static export preview routes * fix(build): emit trailing-slash 404 fallback * docs(build): clarify static export page count
59 lines
2.0 KiB
TypeScript
59 lines
2.0 KiB
TypeScript
export type CatalogItem = {
|
|
slug: string;
|
|
name: string;
|
|
eyebrow: string;
|
|
description: string;
|
|
facts: readonly string[];
|
|
};
|
|
|
|
export const catalog = [
|
|
{
|
|
slug: "pocket-observatory",
|
|
name: "Pocket Observatory",
|
|
eyebrow: "App Router dynamic route",
|
|
description: "A brass field scope for finding constellations beyond the city glow.",
|
|
facts: ["Generated by generateStaticParams", "Metadata generated from params", "Zero runtime API calls"],
|
|
},
|
|
{
|
|
slug: "tide-clock",
|
|
name: "Tide Clock",
|
|
eyebrow: "App Router dynamic route",
|
|
description: "A quiet desk clock that follows the pull of the nearest coastline.",
|
|
facts: ["Server Component rendered at build time", "Hydrates from a static RSC payload", "Works on any file host"],
|
|
},
|
|
{
|
|
slug: "trail-journal",
|
|
name: "Trail Journal",
|
|
eyebrow: "App Router dynamic route",
|
|
description: "Weatherproof pages for routes worth remembering and revisiting.",
|
|
facts: ["One HTML document per slug", "Client navigation stays available", "Unknown slugs resolve to 404"],
|
|
},
|
|
] as const satisfies readonly CatalogItem[];
|
|
|
|
export function getCatalogItem(slug: string): CatalogItem | undefined {
|
|
return catalog.find((item) => item.slug === slug);
|
|
}
|
|
|
|
export const docs = {
|
|
"building/the-artifact": {
|
|
title: "Read the artifact",
|
|
summary: "Everything a static host needs is emitted into dist/client.",
|
|
steps: [
|
|
"Run vinext build, which detects output: export.",
|
|
"Inspect the HTML, RSC payloads, scripts, styles, and public files.",
|
|
"Upload dist/client without a Node.js or Workers runtime.",
|
|
],
|
|
},
|
|
"deployment/cloudflare": {
|
|
title: "Deploy without a server",
|
|
summary: "Cloudflare Workers Static Assets serves the export directly from its asset layer.",
|
|
steps: [
|
|
"Point assets.directory at ./dist/client.",
|
|
"Match html_handling to the trailingSlash export policy.",
|
|
"Use 404-page handling so the generated 404.html remains authoritative.",
|
|
],
|
|
},
|
|
} as const;
|
|
|
|
export type DocsPath = keyof typeof docs;
|