@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,39 @@
|
|
|
1
|
+
import type { UiText } from "./fumadocs-keys.js";
|
|
2
|
+
/** The words the engine's own views print. A `%s` holds a value the view fills in. */
|
|
3
|
+
export type SiteStrings = {
|
|
4
|
+
/** The first breadcrumb, which links to the site root. */
|
|
5
|
+
readonly home: string;
|
|
6
|
+
/** The blog's own name, as a breadcrumb and a heading. */
|
|
7
|
+
readonly blog: string;
|
|
8
|
+
/** The name of the blog as a collection; %s is the publisher. */
|
|
9
|
+
readonly blogCollection: string;
|
|
10
|
+
/** The closing section an article renders from its FAQ frontmatter. */
|
|
11
|
+
readonly questions: string;
|
|
12
|
+
readonly lastReviewed: string;
|
|
13
|
+
readonly updated: string;
|
|
14
|
+
/** The label over an article's table of contents. */
|
|
15
|
+
readonly onThisPage: string;
|
|
16
|
+
/** The link at the foot of the featured post card. */
|
|
17
|
+
readonly readThePost: string;
|
|
18
|
+
/** The category tab that shows every post. */
|
|
19
|
+
readonly allPosts: string;
|
|
20
|
+
/** The accessible name of the category tabs. */
|
|
21
|
+
readonly blogCategories: string;
|
|
22
|
+
readonly featured: string;
|
|
23
|
+
readonly latest: string;
|
|
24
|
+
readonly noPosts: string;
|
|
25
|
+
/** The badge text; %s is the product name, so a language can put it first. */
|
|
26
|
+
readonly builtWith: string;
|
|
27
|
+
/** The website section's pages, as a heading in llms.txt. */
|
|
28
|
+
readonly pages: string;
|
|
29
|
+
/** The docs section, as a heading in llms.txt. */
|
|
30
|
+
readonly docs: string;
|
|
31
|
+
/** The title of the feeds; %s is the publisher. */
|
|
32
|
+
readonly feedTitle: string;
|
|
33
|
+
};
|
|
34
|
+
/** One language: fumadocs-ui's interface text, keyed by its English, and the engine's own words. */
|
|
35
|
+
export type LanguageTable = {
|
|
36
|
+
readonly ui: Readonly<Record<UiText, string>>;
|
|
37
|
+
readonly site: SiteStrings;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/i18n/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,sFAAsF;AACtF,MAAM,MAAM,WAAW,GAAG;IACzB,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,iEAAiE;IACjE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,uEAAuE;IACvE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,qDAAqD;IACrD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,sDAAsD;IACtD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,8CAA8C;IAC9C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,gDAAgD;IAChD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,8EAA8E;IAC9E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,6DAA6D;IAC7D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,kDAAkD;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,oGAAoG;AACpG,MAAM,MAAM,aAAa,GAAG;IAC3B,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC9C,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;CAC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/i18n/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { SiteConfig } from "../config/site-config.js";
|
|
3
|
+
type Analytics = SiteConfig["integrations"]["analytics"];
|
|
4
|
+
/** The analytics script the site config names, for the root layout's head; nothing for none. */
|
|
5
|
+
export declare function AnalyticsScript({ analytics }: {
|
|
6
|
+
readonly analytics: Analytics;
|
|
7
|
+
}): ReactElement | null;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=analytics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/layout/analytics.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,KAAK,SAAS,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC,WAAW,CAAC,CAAC;AAazD,gGAAgG;AAChG,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;CAAE,GAAG,YAAY,GAAG,IAAI,CAIrG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Each provider's documented script tag: its script URL and the attribute that carries the
|
|
4
|
+
* site's key. One tag each, with no inline code, so a static export serves it as it is.
|
|
5
|
+
*/
|
|
6
|
+
const PROVIDERS = {
|
|
7
|
+
plausible: { src: "https://plausible.io/js/script.js", keyAttribute: "data-domain" },
|
|
8
|
+
umami: { src: "https://cloud.umami.is/script.js", keyAttribute: "data-website-id" },
|
|
9
|
+
fathom: { src: "https://cdn.usefathom.com/script.js", keyAttribute: "data-site" },
|
|
10
|
+
};
|
|
11
|
+
/** The analytics script the site config names, for the root layout's head; nothing for none. */
|
|
12
|
+
export function AnalyticsScript({ analytics }) {
|
|
13
|
+
if (analytics.provider === "none")
|
|
14
|
+
return null;
|
|
15
|
+
const { src, keyAttribute } = PROVIDERS[analytics.provider];
|
|
16
|
+
return _jsx("script", { defer: true, src: src, [keyAttribute]: analytics.key });
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=analytics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../src/layout/analytics.tsx"],"names":[],"mappings":";AAMA;;;GAGG;AACH,MAAM,SAAS,GAAuF;IACrG,SAAS,EAAE,EAAE,GAAG,EAAE,mCAAmC,EAAE,YAAY,EAAE,aAAa,EAAE;IACpF,KAAK,EAAE,EAAE,GAAG,EAAE,kCAAkC,EAAE,YAAY,EAAE,iBAAiB,EAAE;IACnF,MAAM,EAAE,EAAE,GAAG,EAAE,qCAAqC,EAAE,YAAY,EAAE,WAAW,EAAE;CACjF,CAAC;AAEF,gGAAgG;AAChG,MAAM,UAAU,eAAe,CAAC,EAAE,SAAS,EAAqC;IAC/E,IAAI,SAAS,CAAC,QAAQ,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IAC/C,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC5D,OAAO,iBAAQ,KAAK,QAAC,GAAG,EAAE,GAAG,EAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,CAAC,GAAG,GAAM,CAAC;AAC1E,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where `ship-site build` puts the brand files a site serves, as URLs. The layout links them and
|
|
3
|
+
* the build writes them, so the two share these names.
|
|
4
|
+
*/
|
|
5
|
+
export declare const BRAND_PUBLIC_PATH = "/_brand";
|
|
6
|
+
/** The default social card, under BRAND_PUBLIC_PATH: the site's name and description. */
|
|
7
|
+
export declare const OG_DEFAULT = "og.png";
|
|
8
|
+
export declare const BRAND_URLS: {
|
|
9
|
+
readonly favicon: "/_brand/favicon.ico";
|
|
10
|
+
readonly faviconSvg: "/_brand/favicon.svg";
|
|
11
|
+
readonly appleTouchIcon: "/_brand/apple-touch-icon.png";
|
|
12
|
+
readonly mark: "/_brand/favicon.svg";
|
|
13
|
+
readonly og: "/_brand/og.png";
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=brand-files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brand-files.d.ts","sourceRoot":"","sources":["../../src/layout/brand-files.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,yFAAyF;AACzF,eAAO,MAAM,UAAU,WAAW,CAAC;AAEnC,eAAO,MAAM,UAAU;;;;;;CAMb,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where `ship-site build` puts the brand files a site serves, as URLs. The layout links them and
|
|
3
|
+
* the build writes them, so the two share these names.
|
|
4
|
+
*/
|
|
5
|
+
export const BRAND_PUBLIC_PATH = "/_brand";
|
|
6
|
+
/** The default social card, under BRAND_PUBLIC_PATH: the site's name and description. */
|
|
7
|
+
export const OG_DEFAULT = "og.png";
|
|
8
|
+
export const BRAND_URLS = {
|
|
9
|
+
favicon: `${BRAND_PUBLIC_PATH}/favicon.ico`,
|
|
10
|
+
faviconSvg: `${BRAND_PUBLIC_PATH}/favicon.svg`,
|
|
11
|
+
appleTouchIcon: `${BRAND_PUBLIC_PATH}/apple-touch-icon.png`,
|
|
12
|
+
mark: `${BRAND_PUBLIC_PATH}/favicon.svg`,
|
|
13
|
+
og: `${BRAND_PUBLIC_PATH}/${OG_DEFAULT}`,
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=brand-files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brand-files.js","sourceRoot":"","sources":["../../src/layout/brand-files.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAE3C,yFAAyF;AACzF,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC;AAEnC,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB,OAAO,EAAE,GAAG,iBAAiB,cAAc;IAC3C,UAAU,EAAE,GAAG,iBAAiB,cAAc;IAC9C,cAAc,EAAE,GAAG,iBAAiB,uBAAuB;IAC3D,IAAI,EAAE,GAAG,iBAAiB,cAAc;IACxC,EAAE,EAAE,GAAG,iBAAiB,IAAI,UAAU,EAAE;CAC/B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { SiteContext } from "../config/context.js";
|
|
3
|
+
/**
|
|
4
|
+
* The site footer: the config's link columns, the brand's links, and the "Built with" badge
|
|
5
|
+
* when the config keeps it on (D42). The badge links back tagged with the site's host.
|
|
6
|
+
*/
|
|
7
|
+
export declare function SiteFooter({ context }: {
|
|
8
|
+
readonly context: SiteContext;
|
|
9
|
+
}): ReactElement;
|
|
10
|
+
//# sourceMappingURL=footer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../../src/layout/footer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAmBxD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAA;CAAE,GAAG,YAAY,CA+BvF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Link from "next/link";
|
|
3
|
+
import { Badge } from "../badge/badge.js";
|
|
4
|
+
/** The brand's own links (website, x, linkedin, ...), named as the DNA names them. */
|
|
5
|
+
function SocialLinks({ links }) {
|
|
6
|
+
const entries = Object.entries(links).sort(([a], [b]) => a.localeCompare(b));
|
|
7
|
+
if (entries.length === 0)
|
|
8
|
+
return null;
|
|
9
|
+
return (_jsx("ul", { className: "flex flex-wrap gap-4", children: entries.map(([name, href]) => (_jsx("li", { children: _jsx("a", { href: href, rel: "me noopener", className: "site-footer-link capitalize", children: name }) }, name))) }));
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The site footer: the config's link columns, the brand's links, and the "Built with" badge
|
|
13
|
+
* when the config keeps it on (D42). The badge links back tagged with the site's host.
|
|
14
|
+
*/
|
|
15
|
+
export function SiteFooter({ context }) {
|
|
16
|
+
const { config, identity, language } = context;
|
|
17
|
+
return (
|
|
18
|
+
// Full width with the container inside: in a flex column layout a footer shrinks to its content.
|
|
19
|
+
_jsx("footer", { className: "site-footer w-full", children: _jsxs("div", { className: "site-container py-10", children: [config.footer.columns.length > 0 ? (_jsx("div", { className: "mb-8 grid grid-cols-2 gap-8 md:grid-cols-4", children: config.footer.columns.map((column) => (_jsxs("nav", { "aria-label": column.title, children: [_jsx("p", { className: "site-footer-title mb-3", children: column.title }), _jsx("ul", { className: "flex flex-col gap-2", children: column.links.map((link) => (_jsx("li", { children: _jsx(Link, { href: link.href, className: "site-footer-link", children: link.label }) }, link.href))) })] }, column.title))) })) : null, _jsxs("div", { className: "flex flex-wrap items-center justify-between gap-4", children: [config.footer.social === "brand-links" ? _jsx(SocialLinks, { links: identity.links }) : _jsx("span", {}), config.footer.badge ? _jsx(Badge, { site: new URL(config.origin).hostname, strings: language.site }) : null] })] }) }));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=footer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer.js","sourceRoot":"","sources":["../../src/layout/footer.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG1C,sFAAsF;AACtF,SAAS,WAAW,CAAC,EAAE,KAAK,EAAwD;IACnF,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACtC,OAAO,CACN,aAAI,SAAS,EAAC,sBAAsB,YAClC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAC9B,uBACC,YAAG,IAAI,EAAE,IAAI,EAAE,GAAG,EAAC,aAAa,EAAC,SAAS,EAAC,6BAA6B,YACtE,IAAI,GACF,IAHI,IAAI,CAIR,CACL,CAAC,GACE,CACL,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,OAAO,EAAqC;IACxE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAC/C,OAAO;IACN,iGAAiG;IACjG,iBAAQ,SAAS,EAAC,oBAAoB,YACrC,eAAK,SAAS,EAAC,sBAAsB,aACnC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CACnC,cAAK,SAAS,EAAC,4CAA4C,YACzD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACtC,6BAAoC,MAAM,CAAC,KAAK,aAC/C,YAAG,SAAS,EAAC,wBAAwB,YAAE,MAAM,CAAC,KAAK,GAAK,EACxD,aAAI,SAAS,EAAC,qBAAqB,YACjC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC3B,uBACC,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,SAAS,EAAC,kBAAkB,YACjD,IAAI,CAAC,KAAK,GACL,IAHC,IAAI,CAAC,IAAI,CAIb,CACL,CAAC,GACE,KAVI,MAAM,CAAC,KAAK,CAWhB,CACN,CAAC,GACG,CACN,CAAC,CAAC,CAAC,IAAI,EACR,eAAK,SAAS,EAAC,mDAAmD,aAChE,MAAM,CAAC,MAAM,CAAC,MAAM,KAAK,aAAa,CAAC,CAAC,CAAC,KAAC,WAAW,IAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,GAAI,CAAC,CAAC,CAAC,gBAAQ,EAC1F,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAC,KAAK,IAAC,IAAI,EAAE,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,IAAI,GAAI,CAAC,CAAC,CAAC,IAAI,IACjG,IACD,GACE,CACT,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { SiteContext } from "../config/context.js";
|
|
3
|
+
/** The 404 page body, in the site's language. */
|
|
4
|
+
export declare function NotFoundView({ context }: {
|
|
5
|
+
readonly context: SiteContext;
|
|
6
|
+
}): ReactElement;
|
|
7
|
+
//# sourceMappingURL=not-found.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not-found.d.ts","sourceRoot":"","sources":["../../src/layout/not-found.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,iDAAiD;AACjD,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAA;CAAE,GAAG,YAAY,CAqBzF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Link from "next/link";
|
|
3
|
+
/** The 404 page body, in the site's language. */
|
|
4
|
+
export function NotFoundView({ context }) {
|
|
5
|
+
const ui = context.language.ui;
|
|
6
|
+
return (_jsxs("div", { className: "site-container flex flex-1 flex-col justify-center py-24 text-center", children: [_jsx("h1", { className: "text-3xl font-bold", style: { color: "var(--site-fg)" }, children: ui["Page Not Found"] }), _jsx("p", { className: "mt-3", style: { color: "var(--site-fg-muted)" }, children: ui["The page you are looking for might have been removed, had its name changed, or is temporarily unavailable."] }), _jsx("p", { className: "mt-6", children: _jsx(Link, { href: "/", className: "site-footer-link", children: ui["Back to Home"] }) })] }));
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=not-found.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not-found.js","sourceRoot":"","sources":["../../src/layout/not-found.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,iDAAiD;AACjD,MAAM,UAAU,YAAY,CAAC,EAAE,OAAO,EAAqC;IAC1E,MAAM,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;IAC/B,OAAO,CACN,eAAK,SAAS,EAAC,sEAAsE,aACpF,aAAI,SAAS,EAAC,oBAAoB,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,YACnE,EAAE,CAAC,gBAAgB,CAAC,GACjB,EACL,YAAG,SAAS,EAAC,MAAM,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,sBAAsB,EAAE,YAE1D,EAAE,CACD,4GAA4G,CAC5G,GAEC,EACJ,YAAG,SAAS,EAAC,MAAM,YAClB,KAAC,IAAI,IAAC,IAAI,EAAC,GAAG,EAAC,SAAS,EAAC,kBAAkB,YACzC,EAAE,CAAC,cAAc,CAAC,GACb,GACJ,IACC,CACN,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
2
|
+
export interface SiteProviderProps {
|
|
3
|
+
readonly locale: string;
|
|
4
|
+
/** fumadocs-ui's text in the site's language (uiTranslations); empty for English. */
|
|
5
|
+
readonly translations: Record<string, string>;
|
|
6
|
+
/** null when the site config turns search off. */
|
|
7
|
+
readonly search: {
|
|
8
|
+
readonly language: string;
|
|
9
|
+
readonly from: string;
|
|
10
|
+
} | null;
|
|
11
|
+
/** Whether the brand has dark colours; without them the site stays light whatever the system prefers. */
|
|
12
|
+
readonly darkMode: boolean;
|
|
13
|
+
readonly children: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/** fumadocs' provider in the site's language, with the static search dialog. */
|
|
16
|
+
export declare function SiteProvider({ locale, translations, search, darkMode, children }: SiteProviderProps): ReactElement;
|
|
17
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/layout/provider.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAGnE,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,qFAAqF;IACrF,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,kDAAkD;IAClD,QAAQ,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC7E,yGAAyG;IACzG,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC7B;AAED,gFAAgF;AAChF,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,iBAAiB,GAAG,YAAY,CAkBlH"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { RootProvider } from "fumadocs-ui/provider/next";
|
|
4
|
+
import { useMemo } from "react";
|
|
5
|
+
import { SiteSearchDialog } from "../search/dialog.js";
|
|
6
|
+
/** fumadocs' provider in the site's language, with the static search dialog. */
|
|
7
|
+
export function SiteProvider({ locale, translations, search, darkMode, children }) {
|
|
8
|
+
const language = search?.language;
|
|
9
|
+
const from = search?.from;
|
|
10
|
+
// One component per language and index, so the dialog keeps its state across renders.
|
|
11
|
+
const SearchDialog = useMemo(() => language && from ? (props) => _jsx(SiteSearchDialog, { ...props, language: language, from: from }) : null, [language, from]);
|
|
12
|
+
return (_jsx(RootProvider, { i18n: { locale, translations }, search: SearchDialog ? { SearchDialog } : { enabled: false }, theme: { enabled: darkMode }, children: children }));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/layout/provider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAqC,OAAO,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAavD,gFAAgF;AAChF,MAAM,UAAU,YAAY,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAqB;IACnG,MAAM,QAAQ,GAAG,MAAM,EAAE,QAAQ,CAAC;IAClC,MAAM,IAAI,GAAG,MAAM,EAAE,IAAI,CAAC;IAC1B,sFAAsF;IACtF,MAAM,YAAY,GAAG,OAAO,CAC3B,GAAG,EAAE,CACJ,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,KAAkB,EAAE,EAAE,CAAC,KAAC,gBAAgB,OAAK,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,GAAI,CAAC,CAAC,CAAC,IAAI,EAClH,CAAC,QAAQ,EAAE,IAAI,CAAC,CAChB,CAAC;IACF,OAAO,CACN,KAAC,YAAY,IACZ,IAAI,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,EAC9B,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAC5D,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,YAE3B,QAAQ,GACK,CACf,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { BaseLayoutProps } from "fumadocs-ui/layouts/shared";
|
|
2
|
+
import type { Metadata } from "next";
|
|
3
|
+
import type { ReactElement, ReactNode } from "react";
|
|
4
|
+
import type { SiteContext } from "../config/context.js";
|
|
5
|
+
/** The root `<html>` of a site: its language, its analytics, fumadocs' provider and search. */
|
|
6
|
+
export declare function SiteRootLayout({ context, children, }: {
|
|
7
|
+
readonly context: SiteContext;
|
|
8
|
+
readonly children: ReactNode;
|
|
9
|
+
}): ReactElement;
|
|
10
|
+
/** The site-wide metadata: names, the title template and the social card defaults. */
|
|
11
|
+
export declare function siteMetadata(context: SiteContext): Metadata;
|
|
12
|
+
/**
|
|
13
|
+
* The header of every fumadocs layout: the logo and the name as text, and the config's links.
|
|
14
|
+
* The logo is the compiled brand mark, so it reads on both grounds; a wordmark would not.
|
|
15
|
+
*/
|
|
16
|
+
export declare function layoutOptions(context: SiteContext, logoSrc: string): BaseLayoutProps;
|
|
17
|
+
//# sourceMappingURL=root.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../src/layout/root.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAQxD,+FAA+F;AAC/F,wBAAgB,cAAc,CAAC,EAC9B,OAAO,EACP,QAAQ,GACR,EAAE;IACF,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC7B,GAAG,YAAY,CAqBf;AAED,sFAAsF;AACtF,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,QAAQ,CAkB3D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,eAAe,CAepF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { uiTranslations } from "../i18n/strings.js";
|
|
3
|
+
import { SEARCH_INDEX_PATH, searchLanguage } from "../search/language.js";
|
|
4
|
+
import { AnalyticsScript } from "./analytics.js";
|
|
5
|
+
import { BRAND_URLS } from "./brand-files.js";
|
|
6
|
+
import { SiteProvider } from "./provider.js";
|
|
7
|
+
/** The root `<html>` of a site: its language, its analytics, fumadocs' provider and search. */
|
|
8
|
+
export function SiteRootLayout({ context, children, }) {
|
|
9
|
+
const { locale } = context.identity;
|
|
10
|
+
const search = context.config.features.search ? { language: searchLanguage(locale), from: SEARCH_INDEX_PATH } : null;
|
|
11
|
+
return (_jsxs("html", { lang: locale, suppressHydrationWarning: true, children: [_jsx("head", { children: _jsx(AnalyticsScript, { analytics: context.config.integrations.analytics }) }), _jsx("body", { className: "flex min-h-screen flex-col font-sans", children: _jsx(SiteProvider, { locale: locale, translations: uiTranslations(locale), search: search, darkMode: context.identity.darkMode, children: children }) })] }));
|
|
12
|
+
}
|
|
13
|
+
/** The site-wide metadata: names, the title template and the social card defaults. */
|
|
14
|
+
export function siteMetadata(context) {
|
|
15
|
+
const { identity, config } = context;
|
|
16
|
+
return {
|
|
17
|
+
metadataBase: new URL(config.origin),
|
|
18
|
+
title: { default: identity.name, template: context.titleTemplate },
|
|
19
|
+
description: identity.description,
|
|
20
|
+
icons: {
|
|
21
|
+
icon: [{ url: BRAND_URLS.favicon }, { url: BRAND_URLS.faviconSvg, type: "image/svg+xml" }],
|
|
22
|
+
apple: BRAND_URLS.appleTouchIcon,
|
|
23
|
+
},
|
|
24
|
+
openGraph: {
|
|
25
|
+
siteName: identity.name,
|
|
26
|
+
locale: identity.locale.replace("-", "_"),
|
|
27
|
+
url: "/",
|
|
28
|
+
images: BRAND_URLS.og,
|
|
29
|
+
},
|
|
30
|
+
twitter: { card: "summary_large_image", images: BRAND_URLS.og },
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The header of every fumadocs layout: the logo and the name as text, and the config's links.
|
|
35
|
+
* The logo is the compiled brand mark, so it reads on both grounds; a wordmark would not.
|
|
36
|
+
*/
|
|
37
|
+
export function layoutOptions(context, logoSrc) {
|
|
38
|
+
return {
|
|
39
|
+
nav: {
|
|
40
|
+
title: (_jsxs("span", { className: "flex items-center gap-2 font-semibold", children: [_jsx("img", { src: logoSrc, width: 24, height: 24, alt: "" }), context.identity.name] })),
|
|
41
|
+
url: "/",
|
|
42
|
+
},
|
|
43
|
+
links: context.config.nav.map((link) => ({ text: link.label, url: link.href })),
|
|
44
|
+
themeSwitch: { enabled: context.identity.darkMode },
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root.js","sourceRoot":"","sources":["../../src/layout/root.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,+FAA+F;AAC/F,MAAM,UAAU,cAAc,CAAC,EAC9B,OAAO,EACP,QAAQ,GAIR;IACA,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC;IACpC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,cAAc,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACrH,OAAO,CACN,gBAAM,IAAI,EAAE,MAAM,EAAE,wBAAwB,mBAE3C,yBACC,KAAC,eAAe,IAAC,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,SAAS,GAAI,GAC/D,EACP,eAAM,SAAS,EAAC,sCAAsC,YACrD,KAAC,YAAY,IACZ,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,cAAc,CAAC,MAAM,CAAC,EACpC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,QAAQ,YAElC,QAAQ,GACK,GACT,IACD,CACP,CAAC;AACH,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,YAAY,CAAC,OAAoB;IAChD,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IACrC,OAAO;QACN,YAAY,EAAE,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC;QACpC,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,aAAa,EAAE;QAClE,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,KAAK,EAAE;YACN,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,UAAU,CAAC,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,UAAU,CAAC,UAAU,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;YAC1F,KAAK,EAAE,UAAU,CAAC,cAAc;SAChC;QACD,SAAS,EAAE;YACV,QAAQ,EAAE,QAAQ,CAAC,IAAI;YACvB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;YACzC,GAAG,EAAE,GAAG;YACR,MAAM,EAAE,UAAU,CAAC,EAAE;SACrB;QACD,OAAO,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,EAAE;KAC/D,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,OAAoB,EAAE,OAAe;IAClE,OAAO;QACN,GAAG,EAAE;YACJ,KAAK,EAAE,CACN,gBAAM,SAAS,EAAC,uCAAuC,aAEtD,cAAK,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAC,EAAE,GAAG,EAClD,OAAO,CAAC,QAAQ,CAAC,IAAI,IAChB,CACP;YACD,GAAG,EAAE,GAAG;SACR;QACD,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAC/E,WAAW,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,QAAQ,EAAE;KACnD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The white-label rule as a check (D25): the engine's code holds no brand. A colour, a font
|
|
3
|
+
* family or the product's own name in a view would show on every site built with it, so each
|
|
4
|
+
* one is a finding. Colours come from the theme contract, fonts from its --font-* stacks and
|
|
5
|
+
* names from the site identity.
|
|
6
|
+
*
|
|
7
|
+
* Comments are left out, because they never reach a page. Two exceptions are deliberate: the
|
|
8
|
+
* badge component, whose job is to name SHIP, and a mask, where a colour is an alpha value and
|
|
9
|
+
* not a colour anyone sees.
|
|
10
|
+
*/
|
|
11
|
+
export type SourceFinding = {
|
|
12
|
+
readonly file: string;
|
|
13
|
+
readonly line: number;
|
|
14
|
+
readonly rule: string;
|
|
15
|
+
readonly text: string;
|
|
16
|
+
};
|
|
17
|
+
/** Every white-label finding in one file of the engine. */
|
|
18
|
+
export declare function lintSource(file: string, text: string): SourceFinding[];
|
|
19
|
+
//# sourceMappingURL=source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/lint/source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB,CAAC;AAkCF,2DAA2D;AAC3D,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa,EAAE,CActE"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const BADGE_FILE = /(^|\/)badge\/badge\.tsx$/;
|
|
2
|
+
const RULES = [
|
|
3
|
+
{ rule: "colour-literal", pattern: /#[0-9a-f]{3,8}\b(?![\w-])/i },
|
|
4
|
+
{ rule: "colour-literal", pattern: /\b(?:rgba?|hsla?|oklch|oklab|lab|lch|hwb)\(/i },
|
|
5
|
+
{
|
|
6
|
+
rule: "colour-literal",
|
|
7
|
+
pattern: /\b(?:color|background|border(?:-color)?|fill|stroke)\s*:\s*["']?(?:white|black|red|blue|green|gray|grey|orange|purple|yellow|pink)\b/i,
|
|
8
|
+
},
|
|
9
|
+
{ rule: "product-name", pattern: /\bSHIP\b/ },
|
|
10
|
+
];
|
|
11
|
+
const FONT_FAMILY = /\bfont-?family\s*:\s*["'`]?([^"'`;}]+)/gi;
|
|
12
|
+
/**
|
|
13
|
+
* A font-family value other than a contract stack (--font-*, --dna-type-*-family) names a font.
|
|
14
|
+
* A value filled from data (`${family}`, as the social card fills it from the DNA) names none.
|
|
15
|
+
*/
|
|
16
|
+
function namesFont(line) {
|
|
17
|
+
const contract = /^(?:var\(--(?:font-|dna-type-[\w-]+-family)|inherit\b|'?\$\{)/;
|
|
18
|
+
return [...line.matchAll(FONT_FAMILY)].some(([, value = ""]) => !contract.test(value.trim()));
|
|
19
|
+
}
|
|
20
|
+
/** The source with comments blanked, keeping line numbers. */
|
|
21
|
+
function withoutComments(text) {
|
|
22
|
+
const blank = (match) => match.replace(/[^\n]/g, " ");
|
|
23
|
+
return text
|
|
24
|
+
.replace(/\/\*[\s\S]*?\*\//g, blank)
|
|
25
|
+
.replace(/(^|[^:"'`])\/\/.*$/gm, (m, lead) => lead + blank(m.slice(lead.length)));
|
|
26
|
+
}
|
|
27
|
+
/** Every white-label finding in one file of the engine. */
|
|
28
|
+
export function lintSource(file, text) {
|
|
29
|
+
const isBadge = BADGE_FILE.test(file);
|
|
30
|
+
return withoutComments(text)
|
|
31
|
+
.split("\n")
|
|
32
|
+
.flatMap((line, index) => [
|
|
33
|
+
...RULES.filter(({ rule, pattern }) => {
|
|
34
|
+
if (rule === "product-name" && isBadge)
|
|
35
|
+
return false;
|
|
36
|
+
if (rule === "colour-literal" && /mask/i.test(line))
|
|
37
|
+
return false;
|
|
38
|
+
return pattern.test(line);
|
|
39
|
+
}).map(({ rule }) => rule),
|
|
40
|
+
...(namesFont(line) ? ["font-family"] : []),
|
|
41
|
+
].map((rule) => ({ file, line: index + 1, rule, text: line.trim() })));
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../src/lint/source.ts"],"names":[],"mappings":"AAiBA,MAAM,UAAU,GAAG,0BAA0B,CAAC;AAE9C,MAAM,KAAK,GAAuE;IACjF,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,4BAA4B,EAAE;IACjE,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,8CAA8C,EAAE;IACnF;QACC,IAAI,EAAE,gBAAgB;QACtB,OAAO,EACN,uIAAuI;KACxI;IACD,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,UAAU,EAAE;CAC7C,CAAC;AAEF,MAAM,WAAW,GAAG,0CAA0C,CAAC;AAE/D;;;GAGG;AACH,SAAS,SAAS,CAAC,IAAY;IAC9B,MAAM,QAAQ,GAAG,+DAA+D,CAAC;IACjF,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AAC/F,CAAC;AAED,8DAA8D;AAC9D,SAAS,eAAe,CAAC,IAAY;IACpC,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC9D,OAAO,IAAI;SACT,OAAO,CAAC,mBAAmB,EAAE,KAAK,CAAC;SACnC,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAAC,EAAE,IAAY,EAAE,EAAE,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAC5F,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,IAAY;IACpD,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtC,OAAO,eAAe,CAAC,IAAI,CAAC;SAC1B,KAAK,CAAC,IAAI,CAAC;SACX,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CACxB;QACC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;YACrC,IAAI,IAAI,KAAK,cAAc,IAAI,OAAO;gBAAE,OAAO,KAAK,CAAC;YACrD,IAAI,IAAI,KAAK,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;gBAAE,OAAO,KAAK,CAAC;YAClE,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC;QAC1B,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KAC3C,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CACrE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface LlmsSite {
|
|
2
|
+
readonly title: string;
|
|
3
|
+
readonly description: string;
|
|
4
|
+
}
|
|
5
|
+
export interface LlmsLink {
|
|
6
|
+
readonly title: string;
|
|
7
|
+
/** Absolute URL of the page's Markdown copy. */
|
|
8
|
+
readonly url: string;
|
|
9
|
+
readonly description?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface LlmsSection {
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly links: ReadonlyArray<LlmsLink>;
|
|
14
|
+
}
|
|
15
|
+
export interface LlmsPage {
|
|
16
|
+
/** Absolute URL of the page the Markdown copies. */
|
|
17
|
+
readonly url: string;
|
|
18
|
+
readonly markdown: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function llmsTxt(site: LlmsSite, sections: ReadonlyArray<LlmsSection>): string;
|
|
21
|
+
export declare function llmsFullTxt(site: LlmsSite, pages: ReadonlyArray<LlmsPage>): string;
|
|
22
|
+
//# sourceMappingURL=llms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llms.d.ts","sourceRoot":"","sources":["../../src/llms/llms.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,QAAQ;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,QAAQ;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gDAAgD;IAChD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,QAAQ;IACxB,oDAAoD;IACpD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC1B;AAWD,wBAAgB,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,MAAM,CAKpF;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,GAAG,MAAM,CAGlF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `llms.txt` and `llms-full.txt` (https://llmstxt.org): the site as an agent reads it. The first
|
|
3
|
+
* lists each page's Markdown copy by section; the second holds all of them in one file, so an
|
|
4
|
+
* agent can take the whole site in one request.
|
|
5
|
+
*/
|
|
6
|
+
import { stripInlineMarkdown } from "../markdown/inline.js";
|
|
7
|
+
const heading = (site) => [`# ${site.title}`, "", `> ${site.description}`, ""];
|
|
8
|
+
const linkLine = (link) => {
|
|
9
|
+
const title = stripInlineMarkdown(link.title);
|
|
10
|
+
return link.description
|
|
11
|
+
? `- [${title}](${link.url}): ${stripInlineMarkdown(link.description)}`
|
|
12
|
+
: `- [${title}](${link.url})`;
|
|
13
|
+
};
|
|
14
|
+
export function llmsTxt(site, sections) {
|
|
15
|
+
const body = sections
|
|
16
|
+
.filter((section) => section.links.length > 0)
|
|
17
|
+
.flatMap((section) => [`## ${section.name}`, "", ...section.links.map(linkLine), ""]);
|
|
18
|
+
return [...heading(site), ...body].join("\n");
|
|
19
|
+
}
|
|
20
|
+
export function llmsFullTxt(site, pages) {
|
|
21
|
+
const body = pages.flatMap((page) => ["---", `Source: ${page.url}`, "", page.markdown.trimEnd(), ""]);
|
|
22
|
+
return [...heading(site), ...body].join("\n");
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=llms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llms.js","sourceRoot":"","sources":["../../src/llms/llms.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAyB5D,MAAM,OAAO,GAAG,CAAC,IAAc,EAAY,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,KAAK,IAAI,CAAC,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;AAEnG,MAAM,QAAQ,GAAG,CAAC,IAAc,EAAU,EAAE;IAC3C,MAAM,KAAK,GAAG,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9C,OAAO,IAAI,CAAC,WAAW;QACtB,CAAC,CAAC,MAAM,KAAK,KAAK,IAAI,CAAC,GAAG,MAAM,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;QACvE,CAAC,CAAC,MAAM,KAAK,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC;AAChC,CAAC,CAAC;AAEF,MAAM,UAAU,OAAO,CAAC,IAAc,EAAE,QAAoC;IAC3E,MAAM,IAAI,GAAG,QAAQ;SACnB,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;SAC7C,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,MAAM,OAAO,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACvF,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IAAc,EAAE,KAA8B;IACzE,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,WAAW,IAAI,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACtG,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface ArticleMarkdownInput {
|
|
2
|
+
readonly title: string;
|
|
3
|
+
readonly description?: string;
|
|
4
|
+
readonly url: string;
|
|
5
|
+
readonly author: string;
|
|
6
|
+
readonly date: Date;
|
|
7
|
+
readonly updated?: Date;
|
|
8
|
+
readonly lastReviewed?: Date;
|
|
9
|
+
/** The page body as processed Markdown, interactive components already removed. */
|
|
10
|
+
readonly body: string;
|
|
11
|
+
readonly faqs?: ReadonlyArray<{
|
|
12
|
+
readonly q: string;
|
|
13
|
+
readonly a: string;
|
|
14
|
+
}>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Turns a site's own MDX components into Markdown before the generic markup is stripped, so a
|
|
18
|
+
* component with a text version (a comparison table, say) keeps its content in the rendition.
|
|
19
|
+
*/
|
|
20
|
+
export type BodyTransform = (body: string) => string;
|
|
21
|
+
/**
|
|
22
|
+
* Remove what only makes sense to the page renderer: component tags, the
|
|
23
|
+
* wrapper tags around fallback content (the content itself is kept, it is the
|
|
24
|
+
* text version of a visual), MDX comments, and the `[#id]` suffix the processor
|
|
25
|
+
* adds to headings. Code blocks are left exactly as written.
|
|
26
|
+
*
|
|
27
|
+
* The processor indents a component's children by two spaces for each level of
|
|
28
|
+
* nesting. Once the tags are gone that indent is meaningless, and at four
|
|
29
|
+
* spaces Markdown reads the text as a code block, so it is removed too.
|
|
30
|
+
*/
|
|
31
|
+
export declare function stripMdxOnlyMarkup(markdown: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* Make site-relative links absolute. The Markdown rendition is read away from
|
|
34
|
+
* the page, often pasted whole into a model's context, where `/docs/mcp` no
|
|
35
|
+
* longer points anywhere. Code blocks are left as written.
|
|
36
|
+
*/
|
|
37
|
+
export declare function absolutizeLinks(markdown: string, origin: string): string;
|
|
38
|
+
/**
|
|
39
|
+
* The plain-Markdown rendition of an article, for agents and anything else that
|
|
40
|
+
* would rather not parse the page. The Questions section is appended from the
|
|
41
|
+
* same frontmatter the page renders it from, so the two renditions match.
|
|
42
|
+
*/
|
|
43
|
+
export declare function renderArticleMarkdown(input: ArticleMarkdownInput, transforms: readonly BodyTransform[]): string;
|
|
44
|
+
//# sourceMappingURL=article.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"article.d.ts","sourceRoot":"","sources":["../../src/markdown/article.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC;IACxB,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC;IAC7B,mFAAmF;IACnF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC;QAAE,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC1E;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;AAgBrD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CA8B3D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CASxE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,SAAS,aAAa,EAAE,GAAG,MAAM,CA0B/G"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { stripInlineMarkdown } from "./inline.js";
|
|
2
|
+
const isoDay = (date) => date.toISOString().slice(0, 10);
|
|
3
|
+
const FENCE = /^\s*(```|~~~)/;
|
|
4
|
+
const TAG_START = /^<\/?[A-Za-z][\w.-]*/;
|
|
5
|
+
const SELF_CLOSING_END = /\/>\s*$/;
|
|
6
|
+
const HEADING_ID = /^(#{1,6} .*?) \[#[\w-]+\]\s*$/;
|
|
7
|
+
/** How a tag line changes the element depth: an opening tag that stays open adds one, a closing tag takes one. */
|
|
8
|
+
function depthChange(tagLine) {
|
|
9
|
+
if (tagLine.startsWith("</"))
|
|
10
|
+
return -1;
|
|
11
|
+
if (SELF_CLOSING_END.test(tagLine) || tagLine.includes("</"))
|
|
12
|
+
return 0;
|
|
13
|
+
return 1;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Remove what only makes sense to the page renderer: component tags, the
|
|
17
|
+
* wrapper tags around fallback content (the content itself is kept, it is the
|
|
18
|
+
* text version of a visual), MDX comments, and the `[#id]` suffix the processor
|
|
19
|
+
* adds to headings. Code blocks are left exactly as written.
|
|
20
|
+
*
|
|
21
|
+
* The processor indents a component's children by two spaces for each level of
|
|
22
|
+
* nesting. Once the tags are gone that indent is meaningless, and at four
|
|
23
|
+
* spaces Markdown reads the text as a code block, so it is removed too.
|
|
24
|
+
*/
|
|
25
|
+
export function stripMdxOnlyMarkup(markdown) {
|
|
26
|
+
const out = [];
|
|
27
|
+
let inFence = false;
|
|
28
|
+
let inTag = false;
|
|
29
|
+
let tagStart = "";
|
|
30
|
+
let depth = 0;
|
|
31
|
+
for (const line of markdown.split("\n")) {
|
|
32
|
+
if (FENCE.test(line))
|
|
33
|
+
inFence = !inFence;
|
|
34
|
+
if (inFence || FENCE.test(line)) {
|
|
35
|
+
out.push(line);
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (inTag) {
|
|
39
|
+
// A multi-line opening tag ends at its closing `>` or `/>`.
|
|
40
|
+
inTag = !/>\s*$/.test(line);
|
|
41
|
+
if (!inTag && !SELF_CLOSING_END.test(line))
|
|
42
|
+
depth += depthChange(tagStart);
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
const trimmed = line.trim();
|
|
46
|
+
if (/^\{\/\*[\s\S]*\*\/\}$/.test(trimmed))
|
|
47
|
+
continue;
|
|
48
|
+
if (TAG_START.test(trimmed)) {
|
|
49
|
+
inTag = !/>\s*$/.test(trimmed) && !SELF_CLOSING_END.test(trimmed);
|
|
50
|
+
tagStart = trimmed;
|
|
51
|
+
if (!inTag)
|
|
52
|
+
depth = Math.max(0, depth + depthChange(trimmed));
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
const dedented = depth > 0 ? line.replace(new RegExp(`^ {0,${depth * 2}}`), "") : line;
|
|
56
|
+
out.push(dedented.replace(HEADING_ID, "$1"));
|
|
57
|
+
}
|
|
58
|
+
return out.join("\n");
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Make site-relative links absolute. The Markdown rendition is read away from
|
|
62
|
+
* the page, often pasted whole into a model's context, where `/docs/mcp` no
|
|
63
|
+
* longer points anywhere. Code blocks are left as written.
|
|
64
|
+
*/
|
|
65
|
+
export function absolutizeLinks(markdown, origin) {
|
|
66
|
+
let inFence = false;
|
|
67
|
+
return markdown
|
|
68
|
+
.split("\n")
|
|
69
|
+
.map((line) => {
|
|
70
|
+
if (FENCE.test(line))
|
|
71
|
+
inFence = !inFence;
|
|
72
|
+
return inFence || FENCE.test(line) ? line : line.replace(/\]\(\/(?!\/)/g, `](${origin}/`);
|
|
73
|
+
})
|
|
74
|
+
.join("\n");
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The plain-Markdown rendition of an article, for agents and anything else that
|
|
78
|
+
* would rather not parse the page. The Questions section is appended from the
|
|
79
|
+
* same frontmatter the page renders it from, so the two renditions match.
|
|
80
|
+
*/
|
|
81
|
+
export function renderArticleMarkdown(input, transforms) {
|
|
82
|
+
const body = transforms.reduce((text, transform) => transform(text), input.body);
|
|
83
|
+
const facts = [
|
|
84
|
+
`- URL: ${input.url}`,
|
|
85
|
+
`- Author: ${input.author}`,
|
|
86
|
+
`- Published: ${isoDay(input.date)}`,
|
|
87
|
+
...(input.updated ? [`- Updated: ${isoDay(input.updated)}`] : []),
|
|
88
|
+
...(input.lastReviewed ? [`- Last reviewed: ${isoDay(input.lastReviewed)}`] : []),
|
|
89
|
+
];
|
|
90
|
+
const questions = input.faqs
|
|
91
|
+
? ["## Questions", "", ...input.faqs.flatMap((faq) => [`### ${faq.q}`, "", faq.a, ""])]
|
|
92
|
+
: [];
|
|
93
|
+
return [
|
|
94
|
+
`# ${stripInlineMarkdown(input.title)}`,
|
|
95
|
+
"",
|
|
96
|
+
...(input.description ? [`> ${stripInlineMarkdown(input.description)}`, ""] : []),
|
|
97
|
+
...facts,
|
|
98
|
+
"",
|
|
99
|
+
absolutizeLinks(stripMdxOnlyMarkup(body), new URL(input.url).origin).trim(),
|
|
100
|
+
"",
|
|
101
|
+
...questions,
|
|
102
|
+
]
|
|
103
|
+
.join("\n")
|
|
104
|
+
.replace(/\n{3,}/g, "\n\n")
|
|
105
|
+
.trimEnd()
|
|
106
|
+
.concat("\n");
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=article.js.map
|