@lets-ship/site 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +59 -2
- package/bin/ship-site.js +5 -0
- package/dist/badge/badge.d.ts +14 -0
- package/dist/badge/badge.d.ts.map +1 -0
- package/dist/badge/badge.js +16 -0
- package/dist/badge/badge.js.map +1 -0
- package/dist/blog/arrow.d.ts +6 -0
- package/dist/blog/arrow.d.ts.map +1 -0
- package/dist/blog/arrow.js +6 -0
- package/dist/blog/arrow.js.map +1 -0
- package/dist/blog/article-view.d.ts +20 -0
- package/dist/blog/article-view.d.ts.map +1 -0
- package/dist/blog/article-view.js +71 -0
- package/dist/blog/article-view.js.map +1 -0
- package/dist/blog/article.d.ts +72 -0
- package/dist/blog/article.d.ts.map +1 -0
- package/dist/blog/article.js +90 -0
- package/dist/blog/article.js.map +1 -0
- package/dist/blog/featured.d.ts +18 -0
- package/dist/blog/featured.d.ts.map +1 -0
- package/dist/blog/featured.js +19 -0
- package/dist/blog/featured.js.map +1 -0
- package/dist/blog/frontmatter.d.ts +155 -0
- package/dist/blog/frontmatter.d.ts.map +1 -0
- package/dist/blog/frontmatter.js +96 -0
- package/dist/blog/frontmatter.js.map +1 -0
- package/dist/blog/index-view.d.ts +21 -0
- package/dist/blog/index-view.d.ts.map +1 -0
- package/dist/blog/index-view.js +70 -0
- package/dist/blog/index-view.js.map +1 -0
- package/dist/blog/inline-markdown.d.ts +15 -0
- package/dist/blog/inline-markdown.d.ts.map +1 -0
- package/dist/blog/inline-markdown.js +44 -0
- package/dist/blog/inline-markdown.js.map +1 -0
- package/dist/blog/post-card.d.ts +37 -0
- package/dist/blog/post-card.d.ts.map +1 -0
- package/dist/blog/post-card.js +68 -0
- package/dist/blog/post-card.js.map +1 -0
- package/dist/blog/site.d.ts +57 -0
- package/dist/blog/site.d.ts.map +1 -0
- package/dist/blog/site.js +76 -0
- package/dist/blog/site.js.map +1 -0
- package/dist/blog/toc.d.ts +32 -0
- package/dist/blog/toc.d.ts.map +1 -0
- package/dist/blog/toc.js +46 -0
- package/dist/blog/toc.js.map +1 -0
- package/dist/config/context.d.ts +16 -0
- package/dist/config/context.d.ts.map +1 -0
- package/dist/config/context.js +11 -0
- package/dist/config/context.js.map +1 -0
- package/dist/config/identity.d.ts +41 -0
- package/dist/config/identity.d.ts.map +1 -0
- package/dist/config/identity.js +28 -0
- package/dist/config/identity.js.map +1 -0
- package/dist/config/json-schema.d.ts +11 -0
- package/dist/config/json-schema.d.ts.map +1 -0
- package/dist/config/json-schema.js +14 -0
- package/dist/config/json-schema.js.map +1 -0
- package/dist/config/site-config.d.ts +145 -0
- package/dist/config/site-config.d.ts.map +1 -0
- package/dist/config/site-config.js +130 -0
- package/dist/config/site-config.js.map +1 -0
- package/dist/docs/page-view.d.ts +21 -0
- package/dist/docs/page-view.d.ts.map +1 -0
- package/dist/docs/page-view.js +27 -0
- package/dist/docs/page-view.js.map +1 -0
- package/dist/feeds/feeds.d.ts +33 -0
- package/dist/feeds/feeds.d.ts.map +1 -0
- package/dist/feeds/feeds.js +122 -0
- package/dist/feeds/feeds.js.map +1 -0
- package/dist/format/dates.d.ts +5 -0
- package/dist/format/dates.d.ts.map +1 -0
- package/dist/format/dates.js +17 -0
- package/dist/format/dates.js.map +1 -0
- package/dist/format/node-text.d.ts +7 -0
- package/dist/format/node-text.d.ts.map +1 -0
- package/dist/format/node-text.js +15 -0
- package/dist/format/node-text.js.map +1 -0
- package/dist/format/toc-depth.d.ts +11 -0
- package/dist/format/toc-depth.d.ts.map +1 -0
- package/dist/format/toc-depth.js +14 -0
- package/dist/format/toc-depth.js.map +1 -0
- package/dist/i18n/fumadocs-keys.d.ts +13 -0
- package/dist/i18n/fumadocs-keys.d.ts.map +1 -0
- package/dist/i18n/fumadocs-keys.js +136 -0
- package/dist/i18n/fumadocs-keys.js.map +1 -0
- package/dist/i18n/strings.d.ts +19 -0
- package/dist/i18n/strings.d.ts.map +1 -0
- package/dist/i18n/strings.js +59 -0
- package/dist/i18n/strings.js.map +1 -0
- package/dist/i18n/tables/de.d.ts +3 -0
- package/dist/i18n/tables/de.d.ts.map +1 -0
- package/dist/i18n/tables/de.js +82 -0
- package/dist/i18n/tables/de.js.map +1 -0
- package/dist/i18n/tables/en.d.ts +3 -0
- package/dist/i18n/tables/en.d.ts.map +1 -0
- package/dist/i18n/tables/en.js +25 -0
- package/dist/i18n/tables/en.js.map +1 -0
- package/dist/i18n/tables/es.d.ts +3 -0
- package/dist/i18n/tables/es.d.ts.map +1 -0
- package/dist/i18n/tables/es.js +82 -0
- package/dist/i18n/tables/es.js.map +1 -0
- package/dist/i18n/tables/fr.d.ts +3 -0
- package/dist/i18n/tables/fr.d.ts.map +1 -0
- package/dist/i18n/tables/fr.js +82 -0
- package/dist/i18n/tables/fr.js.map +1 -0
- package/dist/i18n/tables/nl.d.ts +3 -0
- package/dist/i18n/tables/nl.d.ts.map +1 -0
- package/dist/i18n/tables/nl.js +82 -0
- package/dist/i18n/tables/nl.js.map +1 -0
- package/dist/i18n/tables/pt.d.ts +3 -0
- package/dist/i18n/tables/pt.d.ts.map +1 -0
- package/dist/i18n/tables/pt.js +82 -0
- package/dist/i18n/tables/pt.js.map +1 -0
- package/dist/i18n/tables/tr.d.ts +3 -0
- package/dist/i18n/tables/tr.d.ts.map +1 -0
- package/dist/i18n/tables/tr.js +82 -0
- package/dist/i18n/tables/tr.js.map +1 -0
- package/dist/i18n/types.d.ts +39 -0
- package/dist/i18n/types.d.ts.map +1 -0
- package/dist/i18n/types.js +2 -0
- package/dist/i18n/types.js.map +1 -0
- package/dist/layout/analytics.d.ts +9 -0
- package/dist/layout/analytics.d.ts.map +1 -0
- package/dist/layout/analytics.js +18 -0
- package/dist/layout/analytics.js.map +1 -0
- package/dist/layout/brand-files.d.ts +15 -0
- package/dist/layout/brand-files.d.ts.map +1 -0
- package/dist/layout/brand-files.js +15 -0
- package/dist/layout/brand-files.js.map +1 -0
- package/dist/layout/footer.d.ts +10 -0
- package/dist/layout/footer.d.ts.map +1 -0
- package/dist/layout/footer.js +21 -0
- package/dist/layout/footer.js.map +1 -0
- package/dist/layout/not-found.d.ts +7 -0
- package/dist/layout/not-found.d.ts.map +1 -0
- package/dist/layout/not-found.js +8 -0
- package/dist/layout/not-found.js.map +1 -0
- package/dist/layout/provider.d.ts +17 -0
- package/dist/layout/provider.d.ts.map +1 -0
- package/dist/layout/provider.js +14 -0
- package/dist/layout/provider.js.map +1 -0
- package/dist/layout/root.d.ts +17 -0
- package/dist/layout/root.d.ts.map +1 -0
- package/dist/layout/root.js +47 -0
- package/dist/layout/root.js.map +1 -0
- package/dist/lint/source.d.ts +19 -0
- package/dist/lint/source.d.ts.map +1 -0
- package/dist/lint/source.js +43 -0
- package/dist/lint/source.js.map +1 -0
- package/dist/llms/llms.d.ts +22 -0
- package/dist/llms/llms.d.ts.map +1 -0
- package/dist/llms/llms.js +24 -0
- package/dist/llms/llms.js.map +1 -0
- package/dist/markdown/article.d.ts +44 -0
- package/dist/markdown/article.d.ts.map +1 -0
- package/dist/markdown/article.js +108 -0
- package/dist/markdown/article.js.map +1 -0
- package/dist/markdown/inline.d.ts +40 -0
- package/dist/markdown/inline.d.ts.map +1 -0
- package/dist/markdown/inline.js +74 -0
- package/dist/markdown/inline.js.map +1 -0
- package/dist/markdown/page.d.ts +13 -0
- package/dist/markdown/page.d.ts.map +1 -0
- package/dist/markdown/page.js +21 -0
- package/dist/markdown/page.js.map +1 -0
- package/dist/marker.d.ts +37 -0
- package/dist/marker.d.ts.map +1 -0
- package/dist/marker.js +36 -0
- package/dist/marker.js.map +1 -0
- package/dist/mdx/allow-list.d.ts +23 -0
- package/dist/mdx/allow-list.d.ts.map +1 -0
- package/dist/mdx/allow-list.js +79 -0
- package/dist/mdx/allow-list.js.map +1 -0
- package/dist/mdx/components.d.ts +8 -0
- package/dist/mdx/components.d.ts.map +1 -0
- package/dist/mdx/components.js +68 -0
- package/dist/mdx/components.js.map +1 -0
- package/dist/mdx/remark-alerts.d.ts +4 -0
- package/dist/mdx/remark-alerts.d.ts.map +1 -0
- package/dist/mdx/remark-alerts.js +39 -0
- package/dist/mdx/remark-alerts.js.map +1 -0
- package/dist/next.d.ts +24 -0
- package/dist/next.d.ts.map +1 -0
- package/dist/next.js +55 -0
- package/dist/next.js.map +1 -0
- package/dist/node/bin.d.ts +3 -0
- package/dist/node/bin.d.ts.map +1 -0
- package/dist/node/bin.js +13 -0
- package/dist/node/bin.js.map +1 -0
- package/dist/node/brand.d.ts +13 -0
- package/dist/node/brand.d.ts.map +1 -0
- package/dist/node/brand.js +48 -0
- package/dist/node/brand.js.map +1 -0
- package/dist/node/build.d.ts +31 -0
- package/dist/node/build.d.ts.map +1 -0
- package/dist/node/build.js +151 -0
- package/dist/node/build.js.map +1 -0
- package/dist/node/cli.d.ts +11 -0
- package/dist/node/cli.d.ts.map +1 -0
- package/dist/node/cli.js +80 -0
- package/dist/node/cli.js.map +1 -0
- package/dist/node/config-file.d.ts +5 -0
- package/dist/node/config-file.d.ts.map +1 -0
- package/dist/node/config-file.js +31 -0
- package/dist/node/config-file.js.map +1 -0
- package/dist/node/content.d.ts +6 -0
- package/dist/node/content.d.ts.map +1 -0
- package/dist/node/content.js +36 -0
- package/dist/node/content.js.map +1 -0
- package/dist/node/errors.d.ts +26 -0
- package/dist/node/errors.d.ts.map +1 -0
- package/dist/node/errors.js +34 -0
- package/dist/node/errors.js.map +1 -0
- package/dist/node/files.d.ts +12 -0
- package/dist/node/files.d.ts.map +1 -0
- package/dist/node/files.js +43 -0
- package/dist/node/files.js.map +1 -0
- package/dist/node/og.d.ts +17 -0
- package/dist/node/og.d.ts.map +1 -0
- package/dist/node/og.js +43 -0
- package/dist/node/og.js.map +1 -0
- package/dist/node/project-root.d.ts +12 -0
- package/dist/node/project-root.d.ts.map +1 -0
- package/dist/node/project-root.js +27 -0
- package/dist/node/project-root.js.map +1 -0
- package/dist/node/serve.d.ts +32 -0
- package/dist/node/serve.d.ts.map +1 -0
- package/dist/node/serve.js +133 -0
- package/dist/node/serve.js.map +1 -0
- package/dist/node/theme.d.ts +15 -0
- package/dist/node/theme.d.ts.map +1 -0
- package/dist/node/theme.js +46 -0
- package/dist/node/theme.js.map +1 -0
- package/dist/search/dialog.d.ts +14 -0
- package/dist/search/dialog.d.ts.map +1 -0
- package/dist/search/dialog.js +17 -0
- package/dist/search/dialog.js.map +1 -0
- package/dist/search/language.d.ts +8 -0
- package/dist/search/language.d.ts.map +1 -0
- package/dist/search/language.js +30 -0
- package/dist/search/language.js.map +1 -0
- package/dist/search/route.d.ts +9 -0
- package/dist/search/route.d.ts.map +1 -0
- package/dist/search/route.js +11 -0
- package/dist/search/route.js.map +1 -0
- package/dist/seo/article.d.ts +84 -0
- package/dist/seo/article.d.ts.map +1 -0
- package/dist/seo/article.js +117 -0
- package/dist/seo/article.js.map +1 -0
- package/dist/seo/collection.d.ts +19 -0
- package/dist/seo/collection.d.ts.map +1 -0
- package/dist/seo/collection.js +30 -0
- package/dist/seo/collection.js.map +1 -0
- package/dist/seo/dataset.d.ts +31 -0
- package/dist/seo/dataset.d.ts.map +1 -0
- package/dist/seo/dataset.js +33 -0
- package/dist/seo/dataset.js.map +1 -0
- package/dist/seo/json-ld.d.ts +6 -0
- package/dist/seo/json-ld.d.ts.map +1 -0
- package/dist/seo/json-ld.js +8 -0
- package/dist/seo/json-ld.js.map +1 -0
- package/dist/seo/script-json.d.ts +8 -0
- package/dist/seo/script-json.d.ts.map +1 -0
- package/dist/seo/script-json.js +12 -0
- package/dist/seo/script-json.js.map +1 -0
- package/dist/seo/title.d.ts +11 -0
- package/dist/seo/title.d.ts.map +1 -0
- package/dist/seo/title.js +11 -0
- package/dist/seo/title.js.map +1 -0
- package/dist/seo/x-handle.d.ts +9 -0
- package/dist/seo/x-handle.d.ts.map +1 -0
- package/dist/seo/x-handle.js +21 -0
- package/dist/seo/x-handle.js.map +1 -0
- package/dist/site/app.d.ts +56 -0
- package/dist/site/app.d.ts.map +1 -0
- package/dist/site/app.js +79 -0
- package/dist/site/app.js.map +1 -0
- package/dist/site/features.d.ts +26 -0
- package/dist/site/features.d.ts.map +1 -0
- package/dist/site/features.js +46 -0
- package/dist/site/features.js.map +1 -0
- package/dist/site/metadata.d.ts +6 -0
- package/dist/site/metadata.d.ts.map +1 -0
- package/dist/site/metadata.js +78 -0
- package/dist/site/metadata.js.map +1 -0
- package/dist/site/outputs.d.ts +24 -0
- package/dist/site/outputs.d.ts.map +1 -0
- package/dist/site/outputs.js +113 -0
- package/dist/site/outputs.js.map +1 -0
- package/dist/site/posts.d.ts +6 -0
- package/dist/site/posts.d.ts.map +1 -0
- package/dist/site/posts.js +9 -0
- package/dist/site/posts.js.map +1 -0
- package/dist/site/routes.d.ts +43 -0
- package/dist/site/routes.d.ts.map +1 -0
- package/dist/site/routes.js +94 -0
- package/dist/site/routes.js.map +1 -0
- package/dist/site/site-page.d.ts +11 -0
- package/dist/site/site-page.d.ts.map +1 -0
- package/dist/site/site-page.js +70 -0
- package/dist/site/site-page.js.map +1 -0
- package/dist/site/sources.d.ts +58 -0
- package/dist/site/sources.d.ts.map +1 -0
- package/dist/site/sources.js +2 -0
- package/dist/site/sources.js.map +1 -0
- package/dist/site/url-style.d.ts +21 -0
- package/dist/site/url-style.d.ts.map +1 -0
- package/dist/site/url-style.js +18 -0
- package/dist/site/url-style.js.map +1 -0
- package/dist/website/blocks/commerce.d.ts +41 -0
- package/dist/website/blocks/commerce.d.ts.map +1 -0
- package/dist/website/blocks/commerce.js +26 -0
- package/dist/website/blocks/commerce.js.map +1 -0
- package/dist/website/blocks/content.d.ts +41 -0
- package/dist/website/blocks/content.d.ts.map +1 -0
- package/dist/website/blocks/content.js +25 -0
- package/dist/website/blocks/content.js.map +1 -0
- package/dist/website/blocks/marketing.d.ts +32 -0
- package/dist/website/blocks/marketing.d.ts.map +1 -0
- package/dist/website/blocks/marketing.js +23 -0
- package/dist/website/blocks/marketing.js.map +1 -0
- package/dist/website/blocks/parts.d.ts +26 -0
- package/dist/website/blocks/parts.d.ts.map +1 -0
- package/dist/website/blocks/parts.js +13 -0
- package/dist/website/blocks/parts.js.map +1 -0
- package/dist/website/page-view.d.ts +12 -0
- package/dist/website/page-view.d.ts.map +1 -0
- package/dist/website/page-view.js +10 -0
- package/dist/website/page-view.js.map +1 -0
- package/dist/zod.d.ts +8 -0
- package/dist/zod.d.ts.map +1 -0
- package/dist/zod.js +8 -0
- package/dist/zod.js.map +1 -0
- package/package.json +187 -3
- package/styles.css +326 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { SiteConfig } from "../config/site-config.js";
|
|
2
|
+
/**
|
|
3
|
+
* The optional files of a site. A static export cannot skip a route at build time, so each one
|
|
4
|
+
* lives in a route file named for its feature, `route.<feature>.ts`, and the Next config lists
|
|
5
|
+
* that extension only when the site config turns the feature on: a route that is off is never
|
|
6
|
+
* built, and the export has no file for it.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ROUTE_FEATURES: readonly ["feeds", "llms", "search", "markdown"];
|
|
9
|
+
export type RouteFeature = (typeof ROUTE_FEATURES)[number];
|
|
10
|
+
/** The optional routes the site config turns on. */
|
|
11
|
+
export declare function routeFeatures(config: SiteConfig): RouteFeature[];
|
|
12
|
+
/**
|
|
13
|
+
* Next's page extensions for these features. Next strips the first extension in the list that a
|
|
14
|
+
* file name ends with, so each compound one comes before plain `ts`: otherwise `route.feeds.ts`
|
|
15
|
+
* would read as a file named `route.feeds`, which Next ignores.
|
|
16
|
+
*/
|
|
17
|
+
export declare function pageExtensions(features: readonly RouteFeature[]): string[];
|
|
18
|
+
/** The features as the value of the variable through which the bin hands them to Next. */
|
|
19
|
+
export declare const formatFeatures: (features: readonly RouteFeature[]) => string;
|
|
20
|
+
/** A routes variable that names a feature the engine does not have. */
|
|
21
|
+
export declare class RouteFeatureError extends Error {
|
|
22
|
+
constructor(value: string);
|
|
23
|
+
}
|
|
24
|
+
/** The features in the variable's value; an empty value is no features. */
|
|
25
|
+
export declare function parseFeatures(value: string): RouteFeature[];
|
|
26
|
+
//# sourceMappingURL=features.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../src/site/features.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,cAAc,kDAAmD,CAAC;AAC/E,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D,oDAAoD;AACpD,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,YAAY,EAAE,CAShE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,SAAS,YAAY,EAAE,GAAG,MAAM,EAAE,CAE1E;AAED,0FAA0F;AAC1F,eAAO,MAAM,cAAc,GAAI,UAAU,SAAS,YAAY,EAAE,KAAG,MAA4B,CAAC;AAEhG,uEAAuE;AACvE,qBAAa,iBAAkB,SAAQ,KAAK;gBAC/B,KAAK,EAAE,MAAM;CAIzB;AAID,2EAA2E;AAC3E,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,EAAE,CAM3D"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The optional files of a site. A static export cannot skip a route at build time, so each one
|
|
3
|
+
* lives in a route file named for its feature, `route.<feature>.ts`, and the Next config lists
|
|
4
|
+
* that extension only when the site config turns the feature on: a route that is off is never
|
|
5
|
+
* built, and the export has no file for it.
|
|
6
|
+
*/
|
|
7
|
+
export const ROUTE_FEATURES = ["feeds", "llms", "search", "markdown"];
|
|
8
|
+
/** The optional routes the site config turns on. */
|
|
9
|
+
export function routeFeatures(config) {
|
|
10
|
+
const blog = config.sections.blog;
|
|
11
|
+
const on = {
|
|
12
|
+
feeds: blog !== false && blog.feeds,
|
|
13
|
+
llms: config.features.llms,
|
|
14
|
+
search: config.features.search,
|
|
15
|
+
markdown: config.features.markdownCopies,
|
|
16
|
+
};
|
|
17
|
+
return ROUTE_FEATURES.filter((feature) => on[feature]);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Next's page extensions for these features. Next strips the first extension in the list that a
|
|
21
|
+
* file name ends with, so each compound one comes before plain `ts`: otherwise `route.feeds.ts`
|
|
22
|
+
* would read as a file named `route.feeds`, which Next ignores.
|
|
23
|
+
*/
|
|
24
|
+
export function pageExtensions(features) {
|
|
25
|
+
return [...features.map((feature) => `${feature}.ts`), "tsx", "ts"];
|
|
26
|
+
}
|
|
27
|
+
/** The features as the value of the variable through which the bin hands them to Next. */
|
|
28
|
+
export const formatFeatures = (features) => features.join(",");
|
|
29
|
+
/** A routes variable that names a feature the engine does not have. */
|
|
30
|
+
export class RouteFeatureError extends Error {
|
|
31
|
+
constructor(value) {
|
|
32
|
+
super(`site: "${value}" is not a route feature; the features are ${ROUTE_FEATURES.join(", ")}`);
|
|
33
|
+
this.name = "RouteFeatureError";
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const isFeature = (value) => ROUTE_FEATURES.includes(value);
|
|
37
|
+
/** The features in the variable's value; an empty value is no features. */
|
|
38
|
+
export function parseFeatures(value) {
|
|
39
|
+
const names = value === "" ? [] : value.split(",");
|
|
40
|
+
return names.map((name) => {
|
|
41
|
+
if (!isFeature(name))
|
|
42
|
+
throw new RouteFeatureError(name);
|
|
43
|
+
return name;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=features.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features.js","sourceRoot":"","sources":["../../src/site/features.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,CAAU,CAAC;AAG/E,oDAAoD;AACpD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CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACzB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;YAAE,MAAM,IAAI,iBAAiB,CAAC,IAAI,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC;IACb,CAAC,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Metadata } from "next";
|
|
2
|
+
import { type SiteApp } from "./app.js";
|
|
3
|
+
import { type RouteRow } from "./routes.js";
|
|
4
|
+
/** The metadata of the page at a route row. */
|
|
5
|
+
export declare function rowMetadata(app: SiteApp, row: RouteRow): Metadata;
|
|
6
|
+
//# sourceMappingURL=metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/site/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAMrC,OAAO,EAAe,KAAK,OAAO,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,KAAK,QAAQ,EAAa,MAAM,aAAa,CAAC;AAsDvD,+CAA+C;AAC/C,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,QAAQ,CA0BjE"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { articleMetadata } from "../blog/article.js";
|
|
2
|
+
import { BlogCategoryError } from "../blog/site.js";
|
|
3
|
+
import { fill } from "../i18n/strings.js";
|
|
4
|
+
import { BRAND_URLS } from "../layout/brand-files.js";
|
|
5
|
+
import { stripInlineMarkdown } from "../markdown/inline.js";
|
|
6
|
+
import { requireBlog } from "./app.js";
|
|
7
|
+
import { routePath } from "./routes.js";
|
|
8
|
+
/**
|
|
9
|
+
* Metadata a page states for itself. Next replaces a layout's whole `openGraph` object with a
|
|
10
|
+
* page's, so the card image and the site name come along on every page.
|
|
11
|
+
*/
|
|
12
|
+
function pageMetadata(app, path, text) {
|
|
13
|
+
const { identity, config, titleTemplate } = app.context;
|
|
14
|
+
const title = stripInlineMarkdown(text.title);
|
|
15
|
+
const description = text.description ? stripInlineMarkdown(text.description) : identity.description;
|
|
16
|
+
const markdown = config.features.markdownCopies && text.copy ? { "text/markdown": app.urls.markdownPath(path) } : undefined;
|
|
17
|
+
return {
|
|
18
|
+
// The site root's title is the site's own name, not "Name | Name".
|
|
19
|
+
title: text.root ? { absolute: identity.name } : title,
|
|
20
|
+
description,
|
|
21
|
+
alternates: { canonical: path, ...(markdown ? { types: markdown } : {}) },
|
|
22
|
+
openGraph: {
|
|
23
|
+
type: "website",
|
|
24
|
+
url: path,
|
|
25
|
+
title: text.root ? identity.name : fill(titleTemplate, title),
|
|
26
|
+
description,
|
|
27
|
+
siteName: identity.name,
|
|
28
|
+
locale: identity.locale.replace("-", "_"),
|
|
29
|
+
images: BRAND_URLS.og,
|
|
30
|
+
},
|
|
31
|
+
twitter: { card: "summary_large_image", images: BRAND_URLS.og },
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function blogPostMetadata(app, row) {
|
|
35
|
+
const blog = requireBlog(app);
|
|
36
|
+
const section = { name: blog.strings.blog, path: blog.blogPath };
|
|
37
|
+
const meta = articleMetadata(blog, row.route.entry, { slug: row.route.entry.slug, section, ogImage: BRAND_URLS.og });
|
|
38
|
+
if (app.context.config.features.markdownCopies)
|
|
39
|
+
return meta;
|
|
40
|
+
return { ...meta, alternates: { canonical: meta.alternates?.canonical } };
|
|
41
|
+
}
|
|
42
|
+
function categoryText(app, slug) {
|
|
43
|
+
const blog = app.context.config.sections.blog;
|
|
44
|
+
const category = blog ? blog.categories.find((c) => c.slug === slug) : undefined;
|
|
45
|
+
// The route table makes category pages from the config, so a miss here is a broken table.
|
|
46
|
+
if (!category)
|
|
47
|
+
throw new BlogCategoryError(slug);
|
|
48
|
+
return { title: category.title, description: category.description, root: false, copy: false };
|
|
49
|
+
}
|
|
50
|
+
/** The metadata of the page at a route row. */
|
|
51
|
+
export function rowMetadata(app, row) {
|
|
52
|
+
const path = app.urls.page(routePath(row));
|
|
53
|
+
const root = row.segments.length === 0;
|
|
54
|
+
const route = row.route;
|
|
55
|
+
switch (route.kind) {
|
|
56
|
+
case "page":
|
|
57
|
+
return pageMetadata(app, path, {
|
|
58
|
+
title: route.entry.title,
|
|
59
|
+
description: route.entry.description,
|
|
60
|
+
root,
|
|
61
|
+
copy: true,
|
|
62
|
+
});
|
|
63
|
+
case "docs":
|
|
64
|
+
return pageMetadata(app, path, {
|
|
65
|
+
title: route.entry.title,
|
|
66
|
+
description: route.entry.description,
|
|
67
|
+
root,
|
|
68
|
+
copy: true,
|
|
69
|
+
});
|
|
70
|
+
case "blog-index":
|
|
71
|
+
return pageMetadata(app, path, { title: requireBlog(app).strings.blog, root, copy: false });
|
|
72
|
+
case "blog-category":
|
|
73
|
+
return pageMetadata(app, path, categoryText(app, route.slug));
|
|
74
|
+
case "blog-post":
|
|
75
|
+
return blogPostMetadata(app, { ...row, route });
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../src/site/metadata.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAgB,MAAM,UAAU,CAAC;AACrD,OAAO,EAAiB,SAAS,EAAE,MAAM,aAA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,GAAG,EAAE,EAAE,GAAG,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;IAClD,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { AdvancedIndex } from "fumadocs-core/search/server";
|
|
2
|
+
import type { MetadataRoute } from "next";
|
|
3
|
+
import { type SiteApp } from "./app.js";
|
|
4
|
+
/** A Markdown route asked for a copy no page has; markdownParams lists only real ones. */
|
|
5
|
+
export declare class MarkdownRouteError extends Error {
|
|
6
|
+
constructor(path: string);
|
|
7
|
+
}
|
|
8
|
+
/** `generateStaticParams` of `app/md/[...slug]/route.ts`: one `.md` copy per page of content. */
|
|
9
|
+
export declare function markdownParams(app: SiteApp): Array<{
|
|
10
|
+
slug: string[];
|
|
11
|
+
}>;
|
|
12
|
+
/** The `.md` copy at a Markdown route's params. */
|
|
13
|
+
export declare function markdownAt(app: SiteApp, slug: readonly string[]): Promise<string>;
|
|
14
|
+
/** The body of a feed file, in the given format. */
|
|
15
|
+
export declare function feedBody(app: SiteApp, format: "rss" | "atom" | "json"): string;
|
|
16
|
+
/** `llms.txt`: each page's Markdown copy, by section. */
|
|
17
|
+
export declare function llmsBody(app: SiteApp): string;
|
|
18
|
+
/** `llms-full.txt`: every page's Markdown copy in one file. */
|
|
19
|
+
export declare function llmsFullBody(app: SiteApp): Promise<string>;
|
|
20
|
+
/** The static search index's entries: every page of content, with its structured text. */
|
|
21
|
+
export declare function searchEntries(app: SiteApp): AdvancedIndex[];
|
|
22
|
+
/** Every page of the site, for `app/sitemap.ts`. */
|
|
23
|
+
export declare function sitemapEntries(app: SiteApp): MetadataRoute.Sitemap;
|
|
24
|
+
//# sourceMappingURL=outputs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outputs.d.ts","sourceRoot":"","sources":["../../src/site/outputs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAK1C,OAAO,EAAgC,KAAK,OAAO,EAAE,MAAM,UAAU,CAAC;AA2BtE,0FAA0F;AAC1F,qBAAa,kBAAmB,SAAQ,KAAK;gBAChC,IAAI,EAAE,MAAM;CAIxB;AAED,iGAAiG;AACjG,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAWtE;AAED,mDAAmD;AACnD,wBAAsB,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAKvF;AAYD,oDAAoD;AACpD,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAK9E;AAaD,yDAAyD;AACzD,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAO7C;AAED,+DAA+D;AAC/D,wBAAsB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAOhE;AAED,0FAA0F;AAC1F,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,aAAa,EAAE,CAQ3D;AAED,oDAAoD;AACpD,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,aAAa,CAAC,OAAO,CAKlE"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { atomFeed, jsonFeed, rssFeed } from "../feeds/feeds.js";
|
|
2
|
+
import { llmsFullTxt, llmsTxt } from "../llms/llms.js";
|
|
3
|
+
import { renderArticleMarkdown } from "../markdown/article.js";
|
|
4
|
+
import { renderPageMarkdown } from "../markdown/page.js";
|
|
5
|
+
import { EmptyRouteError, requireBlog } from "./app.js";
|
|
6
|
+
import { postsByDate } from "./posts.js";
|
|
7
|
+
import { routePath } from "./routes.js";
|
|
8
|
+
import { MARKDOWN_ROOT } from "./url-style.js";
|
|
9
|
+
const isContent = (row) => "entry" in row.route;
|
|
10
|
+
const url = (app, row) => `${app.context.config.origin}${app.urls.page(routePath(row))}`;
|
|
11
|
+
async function rowMarkdown(app, row) {
|
|
12
|
+
const route = row.route;
|
|
13
|
+
if (route.kind === "blog-post") {
|
|
14
|
+
const body = await route.entry.markdown();
|
|
15
|
+
return renderArticleMarkdown({ ...route.entry, url: url(app, row), body }, []);
|
|
16
|
+
}
|
|
17
|
+
const body = await route.entry.markdown();
|
|
18
|
+
return renderPageMarkdown({
|
|
19
|
+
title: route.entry.title,
|
|
20
|
+
description: route.entry.description,
|
|
21
|
+
url: url(app, row),
|
|
22
|
+
body,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/** A Markdown route asked for a copy no page has; markdownParams lists only real ones. */
|
|
26
|
+
export class MarkdownRouteError extends Error {
|
|
27
|
+
constructor(path) {
|
|
28
|
+
super(`site: no page has the Markdown copy ${path}`);
|
|
29
|
+
this.name = "MarkdownRouteError";
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/** `generateStaticParams` of `app/md/[...slug]/route.ts`: one `.md` copy per page of content. */
|
|
33
|
+
export function markdownParams(app) {
|
|
34
|
+
const rows = app.rows.filter(isContent);
|
|
35
|
+
if (rows.length === 0) {
|
|
36
|
+
throw new EmptyRouteError("the Markdown copies route", "publish a page, or set features.markdownCopies to false");
|
|
37
|
+
}
|
|
38
|
+
return rows.map((row) => ({
|
|
39
|
+
slug: app.urls
|
|
40
|
+
.markdownPath(routePath(row))
|
|
41
|
+
.slice(MARKDOWN_ROOT.length + 1)
|
|
42
|
+
.split("/"),
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
/** The `.md` copy at a Markdown route's params. */
|
|
46
|
+
export async function markdownAt(app, slug) {
|
|
47
|
+
const path = `${MARKDOWN_ROOT}/${slug.join("/")}`;
|
|
48
|
+
const row = app.rows.filter(isContent).find((r) => app.urls.markdownPath(routePath(r)) === path);
|
|
49
|
+
if (!row)
|
|
50
|
+
throw new MarkdownRouteError(path);
|
|
51
|
+
return rowMarkdown(app, row);
|
|
52
|
+
}
|
|
53
|
+
const feedPost = (post) => ({
|
|
54
|
+
slug: post.slug,
|
|
55
|
+
title: post.title,
|
|
56
|
+
description: post.description,
|
|
57
|
+
author: post.author,
|
|
58
|
+
date: post.date,
|
|
59
|
+
updated: post.updated,
|
|
60
|
+
category: post.category,
|
|
61
|
+
});
|
|
62
|
+
/** The body of a feed file, in the given format. */
|
|
63
|
+
export function feedBody(app, format) {
|
|
64
|
+
const blog = requireBlog(app);
|
|
65
|
+
const posts = postsByDate(app.sources.posts ?? []).map(feedPost);
|
|
66
|
+
if (format === "rss")
|
|
67
|
+
return rssFeed(blog, posts);
|
|
68
|
+
return format === "atom" ? atomFeed(blog, posts) : jsonFeed(blog, posts);
|
|
69
|
+
}
|
|
70
|
+
function llmsLinks(app, kind) {
|
|
71
|
+
return app.rows
|
|
72
|
+
.filter(isContent)
|
|
73
|
+
.filter((row) => row.route.kind === kind)
|
|
74
|
+
.map((row) => ({
|
|
75
|
+
title: row.route.entry.title,
|
|
76
|
+
url: `${app.context.config.origin}${app.urls.markdownPath(routePath(row))}`,
|
|
77
|
+
description: row.route.entry.description,
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
/** `llms.txt`: each page's Markdown copy, by section. */
|
|
81
|
+
export function llmsBody(app) {
|
|
82
|
+
const { identity, language } = app.context;
|
|
83
|
+
return llmsTxt({ title: identity.name, description: identity.description }, [
|
|
84
|
+
{ name: language.site.pages, links: llmsLinks(app, "page") },
|
|
85
|
+
{ name: language.site.blog, links: llmsLinks(app, "blog-post") },
|
|
86
|
+
{ name: language.site.docs, links: llmsLinks(app, "docs") },
|
|
87
|
+
]);
|
|
88
|
+
}
|
|
89
|
+
/** `llms-full.txt`: every page's Markdown copy in one file. */
|
|
90
|
+
export async function llmsFullBody(app) {
|
|
91
|
+
const rows = app.rows.filter(isContent);
|
|
92
|
+
const pages = await Promise.all(rows.map(async (row) => ({ url: url(app, row), markdown: await rowMarkdown(app, row) })));
|
|
93
|
+
const { identity } = app.context;
|
|
94
|
+
return llmsFullTxt({ title: identity.name, description: identity.description }, pages);
|
|
95
|
+
}
|
|
96
|
+
/** The static search index's entries: every page of content, with its structured text. */
|
|
97
|
+
export function searchEntries(app) {
|
|
98
|
+
return app.rows.filter(isContent).map((row) => ({
|
|
99
|
+
id: routePath(row),
|
|
100
|
+
url: app.urls.page(routePath(row)),
|
|
101
|
+
title: row.route.entry.title,
|
|
102
|
+
description: row.route.entry.description,
|
|
103
|
+
structuredData: row.route.entry.structuredData,
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
/** Every page of the site, for `app/sitemap.ts`. */
|
|
107
|
+
export function sitemapEntries(app) {
|
|
108
|
+
return app.rows.map((row) => ({
|
|
109
|
+
url: url(app, row),
|
|
110
|
+
...(row.route.kind === "blog-post" ? { lastModified: row.route.entry.updated ?? row.route.entry.date } : {}),
|
|
111
|
+
}));
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=outputs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outputs.js","sourceRoot":"","sources":["../../src/site/outputs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAiB,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAgB,MAAM,UAAU,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAiB,SAAS,EAAE,MAAM,aAAa,CAAC;A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AAG,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC/C,EAAE,EAAE,SAAS,CAAC,GAAG,CAAC;QAClB,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAClC,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK;QAC5B,WAAW,EAAE,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW;QACxC,cAAc,EAAE,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc;KAC9C,CAAC,CAAC,CAAC;AACL,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,cAAc,CAAC,GAAY;IAC1C,OAAO,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC7B,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC;QAClB,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC5G,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PostEntry } from "./sources.js";
|
|
2
|
+
/** Newest first; ties by slug, so the order never depends on the file system. */
|
|
3
|
+
export declare function postsByDate(posts: readonly PostEntry[]): PostEntry[];
|
|
4
|
+
/** The featured posts, in their `featured` order. */
|
|
5
|
+
export declare function featuredPosts(posts: readonly PostEntry[]): PostEntry[];
|
|
6
|
+
//# sourceMappingURL=posts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posts.d.ts","sourceRoot":"","sources":["../../src/site/posts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,iFAAiF;AACjF,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,GAAG,SAAS,EAAE,CAEpE;AAED,qDAAqD;AACrD,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,GAAG,SAAS,EAAE,CAEtE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Newest first; ties by slug, so the order never depends on the file system. */
|
|
2
|
+
export function postsByDate(posts) {
|
|
3
|
+
return [...posts].sort((a, b) => b.date.getTime() - a.date.getTime() || a.slug.localeCompare(b.slug));
|
|
4
|
+
}
|
|
5
|
+
/** The featured posts, in their `featured` order. */
|
|
6
|
+
export function featuredPosts(posts) {
|
|
7
|
+
return posts.filter((post) => post.featured !== undefined).sort((a, b) => (a.featured ?? 0) - (b.featured ?? 0));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=posts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posts.js","sourceRoot":"","sources":["../../src/site/posts.ts"],"names":[],"mappings":"AAEA,iFAAiF;AACjF,MAAM,UAAU,WAAW,CAAC,KAA2B;IACtD,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACvG,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,aAAa,CAAC,KAA2B;IACxD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC;AAClH,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { SiteConfig } from "../config/site-config.js";
|
|
2
|
+
import type { DocsEntry, PageEntry, PostEntry, SiteSources } from "./sources.js";
|
|
3
|
+
/**
|
|
4
|
+
* Every page a site has, from its config and its content. A section's path is config (a blog sits
|
|
5
|
+
* at `/` on a blog site and at `/blog` inside a website), so the engine routes, not the file system:
|
|
6
|
+
* a template has one catch-all page, and this table says what each path is.
|
|
7
|
+
*/
|
|
8
|
+
export type SiteRoute = {
|
|
9
|
+
readonly kind: "page";
|
|
10
|
+
readonly entry: PageEntry;
|
|
11
|
+
} | {
|
|
12
|
+
readonly kind: "blog-index";
|
|
13
|
+
} | {
|
|
14
|
+
readonly kind: "blog-category";
|
|
15
|
+
readonly slug: string;
|
|
16
|
+
} | {
|
|
17
|
+
readonly kind: "blog-post";
|
|
18
|
+
readonly entry: PostEntry;
|
|
19
|
+
} | {
|
|
20
|
+
readonly kind: "docs";
|
|
21
|
+
readonly entry: DocsEntry;
|
|
22
|
+
};
|
|
23
|
+
export type RouteRow = {
|
|
24
|
+
readonly segments: readonly string[];
|
|
25
|
+
readonly route: SiteRoute;
|
|
26
|
+
};
|
|
27
|
+
/** A section the config turns on with no content source, or the other way round. */
|
|
28
|
+
export declare class SiteSourcesError extends Error {
|
|
29
|
+
constructor(section: string, on: boolean);
|
|
30
|
+
}
|
|
31
|
+
/** Two pages that land on one URL, such as a website page named like the blog's path. */
|
|
32
|
+
export declare class RouteCollisionError extends Error {
|
|
33
|
+
constructor(paths: readonly string[]);
|
|
34
|
+
}
|
|
35
|
+
/** Top-level names the engine serves itself; a page there would never be reached. */
|
|
36
|
+
export declare const RESERVED_SEGMENTS: readonly string[];
|
|
37
|
+
/** Every route, in a fixed order; throws when two land on one path. */
|
|
38
|
+
export declare function routeTable(config: SiteConfig, sources: SiteSources): RouteRow[];
|
|
39
|
+
/** The route at a path given as segments, or undefined for a path the site does not have. */
|
|
40
|
+
export declare function findRoute(rows: readonly RouteRow[], segments: readonly string[]): SiteRoute | undefined;
|
|
41
|
+
/** A route's site-relative path, before the URL style adds or drops a trailing slash. */
|
|
42
|
+
export declare function routePath(row: RouteRow): string;
|
|
43
|
+
//# sourceMappingURL=routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/site/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEjF;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAClB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;CAAE,GACpD;IAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;CAAE,GAC/B;IAAE,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACzD;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;CAAE,GACzD;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAAC;AAExD,MAAM,MAAM,QAAQ,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAAC;AAE3F,oFAAoF;AACpF,qBAAa,gBAAiB,SAAQ,KAAK;gBAC9B,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO;CAQxC;AAED,yFAAyF;AACzF,qBAAa,mBAAoB,SAAQ,KAAK;gBACjC,KAAK,EAAE,SAAS,MAAM,EAAE;CAIpC;AAyCD,qFAAqF;AACrF,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EAY9C,CAAC;AAMF,uEAAuE;AACvE,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,GAAG,QAAQ,EAAE,CAc/E;AAED,6FAA6F;AAC7F,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,QAAQ,EAAE,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GAAG,SAAS,CAGvG;AAED,yFAAyF;AACzF,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,GAAG,MAAM,CAE/C"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/** A section the config turns on with no content source, or the other way round. */
|
|
2
|
+
export class SiteSourcesError extends Error {
|
|
3
|
+
constructor(section, on) {
|
|
4
|
+
super(on
|
|
5
|
+
? `site: the ${section} section is on in site.config.ts, but the template passes no ${section} content`
|
|
6
|
+
: `site: the template passes ${section} content, but site.config.ts turns the ${section} section off`);
|
|
7
|
+
this.name = "SiteSourcesError";
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
/** Two pages that land on one URL, such as a website page named like the blog's path. */
|
|
11
|
+
export class RouteCollisionError extends Error {
|
|
12
|
+
constructor(paths) {
|
|
13
|
+
super(`site: more than one page at ${paths.join(", ")}. Rename one, or move a section in site.config.ts.`);
|
|
14
|
+
this.name = "RouteCollisionError";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const segmentsOf = (path) => path.split("/").filter(Boolean);
|
|
18
|
+
function sourceFor(source, section, on) {
|
|
19
|
+
if (on && source === null)
|
|
20
|
+
throw new SiteSourcesError(section, true);
|
|
21
|
+
if (!on && source !== null)
|
|
22
|
+
throw new SiteSourcesError(section, false);
|
|
23
|
+
return source;
|
|
24
|
+
}
|
|
25
|
+
function websiteRows(config, pages) {
|
|
26
|
+
if (!config.sections.website)
|
|
27
|
+
return [];
|
|
28
|
+
const base = segmentsOf(config.sections.website.path);
|
|
29
|
+
return pages.map((entry) => ({ segments: [...base, ...segmentsOf(entry.slug)], route: { kind: "page", entry } }));
|
|
30
|
+
}
|
|
31
|
+
function blogRows(config, posts) {
|
|
32
|
+
if (!config.sections.blog)
|
|
33
|
+
return [];
|
|
34
|
+
const base = segmentsOf(config.sections.blog.path);
|
|
35
|
+
const used = new Set(posts.map((post) => post.category));
|
|
36
|
+
// Only a category with a post gets a page: an empty one would be a dead end.
|
|
37
|
+
const categories = config.sections.blog.categories.filter((category) => used.has(category.slug));
|
|
38
|
+
return [
|
|
39
|
+
{ segments: base, route: { kind: "blog-index" } },
|
|
40
|
+
...categories.map((c) => ({ segments: [...base, "category", c.slug], route: { kind: "blog-category", slug: c.slug } })),
|
|
41
|
+
...posts.map((entry) => ({ segments: [...base, ...segmentsOf(entry.slug)], route: { kind: "blog-post", entry } })),
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
function docsRows(config, pages) {
|
|
45
|
+
if (!config.sections.docs)
|
|
46
|
+
return [];
|
|
47
|
+
const base = segmentsOf(config.sections.docs.path);
|
|
48
|
+
return pages.map((entry) => ({ segments: [...base, ...entry.slugs], route: { kind: "docs", entry } }));
|
|
49
|
+
}
|
|
50
|
+
const keyOf = (segments) => `/${segments.join("/")}`;
|
|
51
|
+
/** Top-level names the engine serves itself; a page there would never be reached. */
|
|
52
|
+
export const RESERVED_SEGMENTS = [
|
|
53
|
+
"md",
|
|
54
|
+
"api",
|
|
55
|
+
"_brand",
|
|
56
|
+
"_next",
|
|
57
|
+
"feed.xml",
|
|
58
|
+
"atom.xml",
|
|
59
|
+
"feed.json",
|
|
60
|
+
"llms.txt",
|
|
61
|
+
"llms-full.txt",
|
|
62
|
+
"sitemap.xml",
|
|
63
|
+
"robots.txt",
|
|
64
|
+
];
|
|
65
|
+
function reservedPaths(rows) {
|
|
66
|
+
return rows.filter((row) => RESERVED_SEGMENTS.includes(row.segments[0] ?? "")).map((row) => keyOf(row.segments));
|
|
67
|
+
}
|
|
68
|
+
/** Every route, in a fixed order; throws when two land on one path. */
|
|
69
|
+
export function routeTable(config, sources) {
|
|
70
|
+
const pages = sourceFor(sources.pages, "website", config.sections.website !== false);
|
|
71
|
+
const posts = sourceFor(sources.posts, "blog", config.sections.blog !== false);
|
|
72
|
+
const docs = sourceFor(sources.docs, "docs", config.sections.docs !== false);
|
|
73
|
+
const rows = [
|
|
74
|
+
...websiteRows(config, pages ?? []),
|
|
75
|
+
...blogRows(config, posts ?? []),
|
|
76
|
+
...docsRows(config, docs?.pages ?? []),
|
|
77
|
+
];
|
|
78
|
+
const keys = rows.map((row) => keyOf(row.segments));
|
|
79
|
+
const duplicated = [...new Set(keys.filter((key, i) => keys.indexOf(key) !== i))];
|
|
80
|
+
const clashes = [...duplicated, ...reservedPaths(rows)];
|
|
81
|
+
if (clashes.length > 0)
|
|
82
|
+
throw new RouteCollisionError(clashes);
|
|
83
|
+
return rows;
|
|
84
|
+
}
|
|
85
|
+
/** The route at a path given as segments, or undefined for a path the site does not have. */
|
|
86
|
+
export function findRoute(rows, segments) {
|
|
87
|
+
const key = keyOf(segments);
|
|
88
|
+
return rows.find((row) => keyOf(row.segments) === key)?.route;
|
|
89
|
+
}
|
|
90
|
+
/** A route's site-relative path, before the URL style adds or drops a trailing slash. */
|
|
91
|
+
export function routePath(row) {
|
|
92
|
+
return keyOf(row.segments);
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=routes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../src/site/routes.ts"],"names":[],"mappings":"AAiBA,oFAAoF;AACpF,MAAM,OAAO,gBAAiB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AI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC,EAAE,KAAK,CAAC;AAC/D,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,SAAS,CAAC,GAAa;IACtC,OAAO,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Metadata } from "next";
|
|
2
|
+
import type { ReactElement } from "react";
|
|
3
|
+
import { type SiteApp } from "./app.js";
|
|
4
|
+
/** `generateMetadata` of the catch-all page. */
|
|
5
|
+
export declare function siteMetadataAt(app: SiteApp, slug: readonly string[] | undefined): Metadata;
|
|
6
|
+
/** The page at a catch-all route: the right view of the right section, in its layout. */
|
|
7
|
+
export declare function SitePage({ app, slug, }: {
|
|
8
|
+
readonly app: SiteApp;
|
|
9
|
+
readonly slug: readonly string[] | undefined;
|
|
10
|
+
}): ReactElement;
|
|
11
|
+
//# sourceMappingURL=site-page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"site-page.d.ts","sourceRoot":"","sources":["../../src/site/site-page.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,OAAO,CAAC;AASrD,OAAO,EAAe,KAAK,OAAO,EAAE,MAAM,UAAU,CAAC;AAarD,gDAAgD;AAChD,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GAAG,QAAQ,CAI1F;AAwED,yFAAyF;AACzF,wBAAgB,QAAQ,CAAC,EACxB,GAAG,EACH,IAAI,GACJ,EAAE;IACF,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;CAC7C,GAAG,YAAY,CAuBf"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DocsLayout } from "fumadocs-ui/layouts/docs";
|
|
3
|
+
import { HomeLayout } from "fumadocs-ui/layouts/home";
|
|
4
|
+
import { notFound } from "next/navigation";
|
|
5
|
+
import { ArticleView } from "../blog/article-view.js";
|
|
6
|
+
import { BlogIndexView } from "../blog/index-view.js";
|
|
7
|
+
import { DocsPageView } from "../docs/page-view.js";
|
|
8
|
+
import { BRAND_URLS } from "../layout/brand-files.js";
|
|
9
|
+
import { SiteFooter } from "../layout/footer.js";
|
|
10
|
+
import { layoutOptions } from "../layout/root.js";
|
|
11
|
+
import { WebsitePageView } from "../website/page-view.js";
|
|
12
|
+
import { requireBlog } from "./app.js";
|
|
13
|
+
import { rowMetadata } from "./metadata.js";
|
|
14
|
+
import { featuredPosts, postsByDate } from "./posts.js";
|
|
15
|
+
import { SiteSourcesError } from "./routes.js";
|
|
16
|
+
const keyOf = (segments) => segments.join("/");
|
|
17
|
+
function rowAt(app, slug) {
|
|
18
|
+
const key = keyOf(slug ?? []);
|
|
19
|
+
return app.rows.find((row) => keyOf(row.segments) === key);
|
|
20
|
+
}
|
|
21
|
+
/** `generateMetadata` of the catch-all page. */
|
|
22
|
+
export function siteMetadataAt(app, slug) {
|
|
23
|
+
const row = rowAt(app, slug);
|
|
24
|
+
if (!row)
|
|
25
|
+
notFound();
|
|
26
|
+
return rowMetadata(app, row);
|
|
27
|
+
}
|
|
28
|
+
const summary = (post) => ({
|
|
29
|
+
slug: post.slug,
|
|
30
|
+
title: post.title,
|
|
31
|
+
description: post.description,
|
|
32
|
+
date: post.date,
|
|
33
|
+
category: post.category,
|
|
34
|
+
cover: post.image,
|
|
35
|
+
});
|
|
36
|
+
function HomeFrame({ app, children }) {
|
|
37
|
+
return (_jsxs(HomeLayout, { ...layoutOptions(app.context, BRAND_URLS.mark), children: [children, _jsx(SiteFooter, { context: app.context })] }));
|
|
38
|
+
}
|
|
39
|
+
function BlogIndexRoute({ app, category }) {
|
|
40
|
+
const blog = requireBlog(app);
|
|
41
|
+
const posts = postsByDate(app.sources.posts ?? []);
|
|
42
|
+
const used = new Set(posts.map((post) => post.category));
|
|
43
|
+
const config = app.context.config.sections.blog;
|
|
44
|
+
const named = config ? config.categories.find((c) => c.slug === category) : undefined;
|
|
45
|
+
const atRoot = blog.blogPath === "/";
|
|
46
|
+
return (_jsx(BlogIndexView, { site: blog, heading: named?.name ?? (atRoot ? app.context.identity.name : blog.strings.blog), subtitle: named?.description ?? app.context.identity.description, path: category ? blog.categoryPath(category) : blog.blogPath, categories: blog.categories.filter((c) => used.has(c.slug)), activeCategory: category, featured: category ? [] : featuredPosts(posts).map(summary), posts: (category ? posts.filter((p) => p.category === category) : posts).map(summary) }));
|
|
47
|
+
}
|
|
48
|
+
/** The docs content of a docs route: the route table only has docs routes when the template passes some. */
|
|
49
|
+
function requireDocs(app) {
|
|
50
|
+
if (!app.sources.docs)
|
|
51
|
+
throw new SiteSourcesError("docs", true);
|
|
52
|
+
return app.sources.docs;
|
|
53
|
+
}
|
|
54
|
+
function DocsRoute({ app, row, }) {
|
|
55
|
+
const docs = app.context.config.sections.docs;
|
|
56
|
+
const tabs = docs ? docs.tabs.map((tab) => ({ title: tab.label, url: app.urls.page(tab.path) })) : [];
|
|
57
|
+
return (_jsx(DocsLayout, { ...layoutOptions(app.context, BRAND_URLS.mark), tree: requireDocs(app).tree, tabs: tabs.length > 0 ? tabs : false, children: _jsx(DocsPageView, { context: app.context, entry: row.route.entry, components: app.components, after: _jsx(SiteFooter, { context: app.context }) }) }));
|
|
58
|
+
}
|
|
59
|
+
/** The page at a catch-all route: the right view of the right section, in its layout. */
|
|
60
|
+
export function SitePage({ app, slug, }) {
|
|
61
|
+
const row = rowAt(app, slug);
|
|
62
|
+
if (!row)
|
|
63
|
+
notFound();
|
|
64
|
+
const route = row.route;
|
|
65
|
+
if (route.kind === "docs")
|
|
66
|
+
return _jsx(DocsRoute, { app: app, row: { ...row, route } });
|
|
67
|
+
const blog = app.blog;
|
|
68
|
+
return (_jsxs(HomeFrame, { app: app, children: [route.kind === "page" ? _jsx(WebsitePageView, { entry: route.entry, components: app.components }) : null, route.kind === "blog-index" ? _jsx(BlogIndexRoute, { app: app, category: null }) : null, route.kind === "blog-category" ? _jsx(BlogIndexRoute, { app: app, category: route.slug }) : null, route.kind === "blog-post" && blog ? (_jsx(ArticleView, { site: blog, entry: route.entry, slug: route.entry.slug, section: { name: blog.strings.blog, path: blog.blogPath }, ogImage: BRAND_URLS.og, components: app.components })) : null] }));
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=site-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"site-page.js","sourceRoot":"","sources":["../../src/site/site-page.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAgB,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM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