@lets-ship/site 0.0.0-stage → 0.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 +29 -0
- package/dist/blog/toc.d.ts.map +1 -0
- package/dist/blog/toc.js +42 -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 +20 -0
- package/dist/node/build.d.ts.map +1 -0
- package/dist/node/build.js +133 -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/marker.d.ts +24 -0
- package/dist/node/marker.d.ts.map +1 -0
- package/dist/node/marker.js +22 -0
- package/dist/node/marker.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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 IKIGAI Ventures BV
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,60 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @lets-ship/site
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The site engine of SHIP Sites. It builds a website, a blog and docs as one static site, on Next.js and fumadocs. The brand comes from a brand DNA file, so the engine itself has no colours, fonts or names of its own.
|
|
4
|
+
|
|
5
|
+
## Start from a template
|
|
6
|
+
|
|
7
|
+
Most sites start from a SHIP Sites template, which already has this package, a `site.config.ts` and a `brand/brand.dna.json`. To use the package in your own Next.js app, install it with its peer dependencies:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install @lets-ship/site @lets-ship/brand-dna next react react-dom fumadocs-core fumadocs-ui@npm:@fumadocs/base-ui fumadocs-mdx
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## The three inputs
|
|
14
|
+
|
|
15
|
+
| Input | File | What it holds |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| Brand | `brand/brand.dna.json` | The name, the description, the links, the colours and the fonts. |
|
|
18
|
+
| Structure | `site.config.ts` | The sections, the navigation, the footer and the optional files. |
|
|
19
|
+
| Words | `content/` | The pages, the posts and the docs, in MDX. |
|
|
20
|
+
|
|
21
|
+
`site.config.ts` has no defaults. Each key is required, and an unknown key stops the build with its name.
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { defineSiteConfig } from "@lets-ship/site/config";
|
|
25
|
+
|
|
26
|
+
export const site = defineSiteConfig({
|
|
27
|
+
origin: "https://example.com",
|
|
28
|
+
titleSeparator: "|",
|
|
29
|
+
sections: {
|
|
30
|
+
website: { path: "/", content: "./content/pages" },
|
|
31
|
+
blog: false,
|
|
32
|
+
docs: { path: "/docs", content: "./content/docs", editUrl: false, tabs: [] },
|
|
33
|
+
},
|
|
34
|
+
nav: [{ label: "Docs", href: "/docs" }],
|
|
35
|
+
mdxComponents: [],
|
|
36
|
+
footer: { columns: [], social: "brand-links", badge: true },
|
|
37
|
+
features: { search: true, markdownCopies: true, llms: true },
|
|
38
|
+
integrations: { analytics: { provider: "none" } },
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
The JSON Schema of the config is at `https://letsship.ai/schema/site.json`.
|
|
43
|
+
|
|
44
|
+
## The ship-site command
|
|
45
|
+
|
|
46
|
+
| Command | What it does |
|
|
47
|
+
| --- | --- |
|
|
48
|
+
| `ship-site build` | Checks the config, the brand and the content, builds the site into `out/`, checks the output and writes `out/.ship-site.json`. |
|
|
49
|
+
| `ship-site check` | Runs the same checks without a build. |
|
|
50
|
+
| `ship-site theme` | Compiles the brand into `.ship-site/theme` and `public/_brand`. |
|
|
51
|
+
| `ship-site dev` | Compiles the brand and runs the Next.js dev server. |
|
|
52
|
+
| `ship-site serve out` | Serves a built site with the hosting rules. |
|
|
53
|
+
|
|
54
|
+
Exit code 1 is a problem in the site's own files, 2 is a wrong command line, and 70 is a failed build step. Each message names the file and the fix.
|
|
55
|
+
|
|
56
|
+
Two builds of the same inputs give the same bytes. The marker file records the hash of the inputs and of the output.
|
|
57
|
+
|
|
58
|
+
## License
|
|
59
|
+
|
|
60
|
+
MIT
|
package/bin/ship-site.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// The ship-site command. A committed file rather than dist/node/bin.js itself: a package manager
|
|
3
|
+
// links a bin when it installs the package, and in a workspace the package is installed before
|
|
4
|
+
// it is built, so a bin inside dist/ would never be linked.
|
|
5
|
+
import "../dist/node/bin.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import { type SiteStrings } from "../i18n/strings.js";
|
|
3
|
+
/** Where the badge links: SHIP Sites, tagged with the site's host, so a signup counts back to it (D42). */
|
|
4
|
+
export declare function badgeHref(site: string): string;
|
|
5
|
+
/**
|
|
6
|
+
* "Built with SHIP" (D34, D42): a small text link in the footer, in the site's own colours, never
|
|
7
|
+
* a banner. The one place in the engine that names SHIP. `data-ship-badge` is what the build
|
|
8
|
+
* and hosting look for (BADGE_ATTRIBUTE) when the plan requires the badge.
|
|
9
|
+
*/
|
|
10
|
+
export declare function Badge({ site, strings }: {
|
|
11
|
+
readonly site: string;
|
|
12
|
+
readonly strings: SiteStrings;
|
|
13
|
+
}): ReactElement;
|
|
14
|
+
//# sourceMappingURL=badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../src/badge/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAQ,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAG5D,2GAA2G;AAC3G,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAA;CAAE,GAAG,YAAY,CAM/G"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { fill } from "../i18n/strings.js";
|
|
3
|
+
import { BADGE_ATTRIBUTE } from "../marker.js";
|
|
4
|
+
/** Where the badge links: SHIP Sites, tagged with the site's host, so a signup counts back to it (D42). */
|
|
5
|
+
export function badgeHref(site) {
|
|
6
|
+
return `https://letsship.ai/sites?ref=${encodeURIComponent(site)}`;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* "Built with SHIP" (D34, D42): a small text link in the footer, in the site's own colours, never
|
|
10
|
+
* a banner. The one place in the engine that names SHIP. `data-ship-badge` is what the build
|
|
11
|
+
* and hosting look for (BADGE_ATTRIBUTE) when the plan requires the badge.
|
|
12
|
+
*/
|
|
13
|
+
export function Badge({ site, strings }) {
|
|
14
|
+
return (_jsx("a", { href: badgeHref(site), className: "site-badge", [BADGE_ATTRIBUTE]: "", rel: "noopener", children: fill(strings.builtWith, "SHIP") }));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.js","sourceRoot":"","sources":["../../src/badge/badge.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAoB,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,2GAA2G;AAC3G,MAAM,UAAU,SAAS,CAAC,IAAY;IACrC,OAAO,iCAAiC,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC;AACpE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,IAAI,EAAE,OAAO,EAA4D;IAChG,OAAO,CACN,YAAG,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,EAAE,SAAS,EAAC,YAAY,EAAO,CAAC,eAAe,CAAC,EAAE,EAAE,EAAI,GAAG,EAAC,UAAU,YAC5F,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,GAC7B,CACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrow.d.ts","sourceRoot":"","sources":["../../src/blog/arrow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,+FAA+F;AAC/F,wBAAgB,KAAK,CAAC,EAAE,IAAS,EAAE,EAAE;IAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,YAAY,CAc7E"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/** A right arrow for "read more" links. Path from Phosphor's ArrowRight, bold weight (MIT). */
|
|
3
|
+
export function Arrow({ size = 16 }) {
|
|
4
|
+
return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, fill: "currentColor", viewBox: "0 0 256 256", className: "site-arrow", "aria-hidden": true, children: _jsx("path", { d: "M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z" }) }));
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=arrow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrow.js","sourceRoot":"","sources":["../../src/blog/arrow.tsx"],"names":[],"mappings":";AACA,+FAA+F;AAC/F,MAAM,UAAU,KAAK,CAAC,EAAE,IAAI,GAAG,EAAE,EAA8B;IAC9D,OAAO,CACN,cACC,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,IAAI,EACZ,IAAI,EAAC,cAAc,EACnB,OAAO,EAAC,aAAa,EACrB,SAAS,EAAC,YAAY,iCAGtB,eAAM,CAAC,EAAC,yIAAyI,GAAG,GAC/I,CACN,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { MDXComponents } from "mdx/types";
|
|
2
|
+
import type { ReactElement, ReactNode } from "react";
|
|
3
|
+
import { type ArticleEntry, type ArticleSection } from "./article.js";
|
|
4
|
+
import { type BlogSite } from "./site.js";
|
|
5
|
+
export interface ArticleViewProps {
|
|
6
|
+
readonly site: BlogSite;
|
|
7
|
+
readonly entry: ArticleEntry;
|
|
8
|
+
readonly slug: string;
|
|
9
|
+
readonly section: ArticleSection;
|
|
10
|
+
/** Pages that make claims about others show when those claims were last checked. */
|
|
11
|
+
readonly lastReviewed?: Date;
|
|
12
|
+
/** Site-relative path of the page's social card, the same one its metadata advertises. */
|
|
13
|
+
readonly ogImage: string;
|
|
14
|
+
/** The MDX components the body may use: the engine's allow-list plus the site's own. */
|
|
15
|
+
readonly components: MDXComponents;
|
|
16
|
+
/** What follows the article, such as a call to action. Each page brings its own. */
|
|
17
|
+
readonly after?: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export declare function ArticleView({ site, entry, slug, section, lastReviewed, ogImage, components, after, }: ArticleViewProps): ReactElement;
|
|
20
|
+
//# sourceMappingURL=article-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"article-view.d.ts","sourceRoot":"","sources":["../../src/blog/article-view.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG/C,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMrD,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,cAAc,EAKnB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,KAAK,QAAQ,EAAgB,MAAM,WAAW,CAAC;AA6IxD,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,oFAAoF;IACpF,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC;IAC7B,0FAA0F;IAC1F,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,wFAAwF;IACxF,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC;IACnC,oFAAoF;IACpF,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;CAC3B;AAED,wBAAgB,WAAW,CAAC,EAC3B,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,OAAO,EACP,YAAY,EACZ,OAAO,EACP,UAAU,EACV,KAAK,GACL,EAAE,gBAAgB,GAAG,YAAY,CAqCjC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { DocsBody } from "fumadocs-ui/layouts/notebook/page";
|
|
3
|
+
import Image from "next/image";
|
|
4
|
+
import Link from "next/link";
|
|
5
|
+
import { formatLongDate } from "../format/dates.js";
|
|
6
|
+
import { tocToDepth } from "../format/toc-depth.js";
|
|
7
|
+
import { stripInlineMarkdown } from "../markdown/inline.js";
|
|
8
|
+
import { datasetJsonLd } from "../seo/dataset.js";
|
|
9
|
+
import { JsonLd } from "../seo/json-ld.js";
|
|
10
|
+
import { articlePath, articleStructuredData, QUESTIONS_ID, withQuestions, } from "./article.js";
|
|
11
|
+
import { InlineMarkdown } from "./inline-markdown.js";
|
|
12
|
+
import { postCategory } from "./site.js";
|
|
13
|
+
import { BlogTOC, BlogTOCInline, BlogTOCProvider } from "./toc.js";
|
|
14
|
+
const MUTED = { color: "var(--site-fg-muted)", fontFamily: "var(--font-mono)" };
|
|
15
|
+
const LINK_HOVER = "transition-colors hover:text-[var(--site-fg)]";
|
|
16
|
+
/** The closing Questions section, inside the body so it takes the prose styles. */
|
|
17
|
+
function ArticleQuestions({ site, faqs, }) {
|
|
18
|
+
return (_jsxs("section", { "aria-labelledby": QUESTIONS_ID, children: [_jsx("h2", { id: QUESTIONS_ID, children: site.strings.questions }), faqs.map((faq) => (_jsxs("div", { children: [_jsx("h3", { children: faq.q }), _jsx("p", { children: _jsx(InlineMarkdown, { text: faq.a }) })] }, faq.q)))] }));
|
|
19
|
+
}
|
|
20
|
+
function Divider() {
|
|
21
|
+
return _jsx("span", { style: { color: "var(--site-border)" }, children: "|" });
|
|
22
|
+
}
|
|
23
|
+
function DateLine({ label, date, locale }) {
|
|
24
|
+
return (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsxs("span", { children: [label, " ", _jsx("time", { dateTime: date.toISOString(), children: formatLongDate(date, locale) })] })] }));
|
|
25
|
+
}
|
|
26
|
+
function BackLink({ section, onCover }) {
|
|
27
|
+
// On a cover the inset scales with the band: 22:5 is about 210px tall in the content column
|
|
28
|
+
// but 80px on a phone, where a 16px inset would put the link at mid height.
|
|
29
|
+
const placement = onCover ? "absolute left-3 top-2 sm:left-5 sm:top-4" : "mb-6";
|
|
30
|
+
return (_jsxs(Link, { href: section.path, className: `${placement} inline-flex items-center gap-1.5 text-sm ${LINK_HOVER}`, style: MUTED, children: ["\u2190 ", section.name] }));
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The cover, cropped to a 22:5 band so the headline stays on the first screen, with the back
|
|
34
|
+
* link on it. Only the bottom fifth fades, through a mask rather than a gradient overlay: a mask
|
|
35
|
+
* fades to whatever is behind it, so it stays right on any background and in both themes.
|
|
36
|
+
*/
|
|
37
|
+
function ArticleCover({ entry, section }) {
|
|
38
|
+
if (!entry.image)
|
|
39
|
+
return _jsx(BackLink, { section: section, onCover: false });
|
|
40
|
+
const maskFade = "linear-gradient(to bottom, #000 78%, transparent 100%)";
|
|
41
|
+
return (_jsxs("figure", { className: "relative mb-6 aspect-[22/5] overflow-hidden", children: [_jsx(Image, { src: entry.image, alt: entry.imageAlt ?? stripInlineMarkdown(entry.title), width: 2400, height: 1260, className: "h-full w-full object-cover", priority: true, quality: 90, sizes: "(min-width: 1280px) 1216px, 94vw", style: { maskImage: maskFade, WebkitMaskImage: maskFade } }), _jsx(BackLink, { section: section, onCover: true })] }));
|
|
42
|
+
}
|
|
43
|
+
/** Date, byline, category and freshness, above the title so the title sits next to the body. */
|
|
44
|
+
function ArticleMeta({ site, entry, lastReviewed }) {
|
|
45
|
+
const category = postCategory(site, entry.category);
|
|
46
|
+
return (_jsxs("div", { className: "mb-4 flex flex-wrap items-center gap-3 text-xs", style: MUTED, children: [_jsx("time", { dateTime: entry.date.toISOString(), children: formatLongDate(entry.date, site.locale) }), _jsx(Divider, {}), _jsx(Link, { href: site.authorPath(entry.author), rel: "author", className: LINK_HOVER, children: entry.author }), category ? (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsx(Link, { href: category.path, className: LINK_HOVER, children: category.name })] })) : null, lastReviewed ? _jsx(DateLine, { label: site.strings.lastReviewed, date: lastReviewed, locale: site.locale }) : null, !lastReviewed && entry.updated ? (_jsx(DateLine, { label: site.strings.updated, date: entry.updated, locale: site.locale })) : null] }));
|
|
47
|
+
}
|
|
48
|
+
/** The standfirst is the meta description too, so the two summaries cannot drift apart. */
|
|
49
|
+
function ArticleHeader(props) {
|
|
50
|
+
const { entry } = props;
|
|
51
|
+
return (_jsxs("header", { className: "mb-8 border-b pb-8", style: { borderColor: "var(--site-border)" }, children: [_jsx(ArticleMeta, { ...props }), _jsx("h1", { className: "text-3xl font-bold leading-tight", style: { color: "var(--site-fg)", fontFamily: "var(--font-sans)" }, children: _jsx(InlineMarkdown, { text: entry.title, inHeading: true }) }), entry.description ? (_jsx("p", { className: "mt-4 max-w-2xl text-lg leading-relaxed", style: { color: "var(--site-fg-muted)", fontFamily: "var(--font-sans)" }, children: _jsx(InlineMarkdown, { text: entry.description }) })) : null] }));
|
|
52
|
+
}
|
|
53
|
+
export function ArticleView({ site, entry, slug, section, lastReviewed, ogImage, components, after, }) {
|
|
54
|
+
const MDX = entry.body;
|
|
55
|
+
const pageUrl = `${site.origin}${site.page(articlePath(section, slug))}`;
|
|
56
|
+
// A post chooses how deep its contents tree goes; absent means every heading.
|
|
57
|
+
const toc = withQuestions(site, tocToDepth(entry.toc, entry.tocDepth), entry);
|
|
58
|
+
const modified = lastReviewed ?? entry.updated;
|
|
59
|
+
const dataset = entry.dataset
|
|
60
|
+
? datasetJsonLd(entry.dataset, {
|
|
61
|
+
origin: site.origin,
|
|
62
|
+
publisher: site.publisher,
|
|
63
|
+
pageUrl,
|
|
64
|
+
author: entry.author,
|
|
65
|
+
datePublished: entry.date,
|
|
66
|
+
articleType: entry.schemaType,
|
|
67
|
+
})
|
|
68
|
+
: undefined;
|
|
69
|
+
return (_jsxs(BlogTOCProvider, { toc: toc, children: [_jsx(JsonLd, { json: articleStructuredData(site, entry, { pageUrl, section, ogImage, modified }) }), dataset ? _jsx(JsonLd, { json: dataset }) : null, _jsx("div", { className: "site-blog pt-8 pb-16 md:pb-24", "data-blog-slug": slug, children: _jsxs("div", { className: "site-container flex gap-12", children: [_jsxs("article", { className: "min-w-0 flex-1", children: [_jsx(ArticleCover, { entry: entry, section: section }), _jsx(ArticleHeader, { site: site, entry: entry, lastReviewed: lastReviewed }), _jsx(BlogTOCInline, { toc: toc, label: site.strings.onThisPage }), _jsxs(DocsBody, { children: [_jsx(MDX, { components: components }), entry.faqs ? _jsx(ArticleQuestions, { site: site, faqs: entry.faqs }) : null] })] }), _jsx(BlogTOC, { toc: toc, label: site.strings.onThisPage })] }) }), after] }));
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=article-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"article-view.js","sourceRoot":"","sources":["../../src/blog/article-view.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAE7D,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAGN,WAAW,EACX,qBAAqB,EACrB,YAAY,EACZ,aAAa,GACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,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G,aACxB,KAAC,MAAM,IAAC,IAAI,EAAE,qBAAqB,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,GAAI,EAC5F,OAAO,CAAC,CAAC,CAAC,KAAC,MAAM,IAAC,IAAI,EAAE,OAAO,GAAI,CAAC,CAAC,CAAC,IAAI,EAC3C,cAAK,SAAS,EAAC,+BAA+B,oBAAiB,IAAI,YAClE,eAAK,SAAS,EAAC,4BAA4B,aAC1C,mBAAS,SAAS,EAAC,gBAAgB,aAClC,KAAC,YAAY,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAI,EAChD,KAAC,aAAa,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,GAAI,EACvE,KAAC,aAAa,IAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,GAAI,EAC3D,MAAC,QAAQ,eACR,KAAC,GAAG,IAAC,UAAU,EAAE,UAAU,GAAI,EAC9B,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAC,gBAAgB,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,GAAI,CAAC,CAAC,CAAC,IAAI,IAC7D,IACF,EACV,KAAC,OAAO,IAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,GAAI,IAChD,GACD,EACL,KAAK,IACW,CAClB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { TOCItemType } from "fumadocs-core/toc";
|
|
2
|
+
import type { MDXComponents } from "mdx/types";
|
|
3
|
+
import type { Metadata } from "next";
|
|
4
|
+
import type { ComponentType } from "react";
|
|
5
|
+
import { type ArticleType } from "../seo/article.js";
|
|
6
|
+
import type { PostDataset } from "../seo/dataset.js";
|
|
7
|
+
import { type BlogSite, type NamedPath } from "./site.js";
|
|
8
|
+
/** The fields a blog post and any other article page share. */
|
|
9
|
+
export interface ArticleEntry {
|
|
10
|
+
readonly title: string;
|
|
11
|
+
/** A shorter document title for search results, when the headline runs long. */
|
|
12
|
+
readonly seoTitle?: string;
|
|
13
|
+
readonly description?: string;
|
|
14
|
+
readonly author: string;
|
|
15
|
+
readonly date: Date;
|
|
16
|
+
readonly updated?: Date;
|
|
17
|
+
readonly image?: string;
|
|
18
|
+
readonly imageAlt?: string;
|
|
19
|
+
readonly tocDepth?: number;
|
|
20
|
+
readonly toc: TOCItemType[];
|
|
21
|
+
readonly body: ComponentType<{
|
|
22
|
+
components?: MDXComponents;
|
|
23
|
+
}>;
|
|
24
|
+
readonly dataset?: PostDataset;
|
|
25
|
+
/** Blog posts only: the category slug from the site config. */
|
|
26
|
+
readonly category?: string;
|
|
27
|
+
readonly schemaType?: ArticleType;
|
|
28
|
+
readonly faqs?: ReadonlyArray<{
|
|
29
|
+
readonly q: string;
|
|
30
|
+
readonly a: string;
|
|
31
|
+
}>;
|
|
32
|
+
readonly howTo?: {
|
|
33
|
+
readonly name: string;
|
|
34
|
+
readonly steps: ReadonlyArray<{
|
|
35
|
+
readonly heading: string;
|
|
36
|
+
readonly text: string;
|
|
37
|
+
}>;
|
|
38
|
+
};
|
|
39
|
+
readonly itemList?: {
|
|
40
|
+
readonly name: string;
|
|
41
|
+
readonly items: ReadonlyArray<{
|
|
42
|
+
readonly name: string;
|
|
43
|
+
readonly url?: string;
|
|
44
|
+
}>;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/** The section an article belongs to: its breadcrumb and back-link label, and its path. */
|
|
48
|
+
export type ArticleSection = NamedPath;
|
|
49
|
+
/** An article's site-relative path: under its section, which may be the site root. */
|
|
50
|
+
export declare function articlePath(section: ArticleSection, slug: string): string;
|
|
51
|
+
export type ArticleMetadataEntry = Pick<ArticleEntry, "title" | "seoTitle" | "description" | "author" | "date" | "updated">;
|
|
52
|
+
/**
|
|
53
|
+
* Page metadata for an article. The title and description may carry inline markdown for the
|
|
54
|
+
* reader-facing heading and standfirst; none of it belongs in a document title, a meta
|
|
55
|
+
* description or a social card, so every field takes the stripped string.
|
|
56
|
+
*/
|
|
57
|
+
export declare function articleMetadata(site: BlogSite, entry: ArticleMetadataEntry, page: {
|
|
58
|
+
readonly slug: string;
|
|
59
|
+
readonly section: ArticleSection;
|
|
60
|
+
readonly ogImage: string;
|
|
61
|
+
}, lastReviewed?: Date): Metadata;
|
|
62
|
+
/** Anchor of the Questions section; listed in the contents tree like any heading. */
|
|
63
|
+
export declare const QUESTIONS_ID = "questions";
|
|
64
|
+
export declare function withQuestions(site: BlogSite, toc: TOCItemType[], entry: ArticleEntry): TOCItemType[];
|
|
65
|
+
export interface ArticleJsonLdContext {
|
|
66
|
+
readonly pageUrl: string;
|
|
67
|
+
readonly section: ArticleSection;
|
|
68
|
+
readonly ogImage: string;
|
|
69
|
+
readonly modified?: Date;
|
|
70
|
+
}
|
|
71
|
+
export declare function articleStructuredData(site: BlogSite, entry: ArticleEntry, ctx: ArticleJsonLdContext): string;
|
|
72
|
+
//# sourceMappingURL=article.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"article.d.ts","sourceRoot":"","sources":["../../src/blog/article.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,KAAK,WAAW,EAAoC,MAAM,mBAAmB,CAAC;AACvF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAg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AAqB,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,oBAAoB,GAAG,MAAM,CA2B5G"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { nodeText } from "../format/node-text.js";
|
|
2
|
+
import { fill } from "../i18n/strings.js";
|
|
3
|
+
import { stripInlineMarkdown } from "../markdown/inline.js";
|
|
4
|
+
import { articleJsonLd, resolveHowToSteps } from "../seo/article.js";
|
|
5
|
+
import { searchTitle } from "../seo/title.js";
|
|
6
|
+
import { postCategory } from "./site.js";
|
|
7
|
+
/** An article's site-relative path: under its section, which may be the site root. */
|
|
8
|
+
export function articlePath(section, slug) {
|
|
9
|
+
return `${section.path.replace(/\/$/, "")}/${slug}`;
|
|
10
|
+
}
|
|
11
|
+
/** `twitter.site` when the brand has an X account, and `twitter.creator` when the author has one. */
|
|
12
|
+
function xAccounts(site, author) {
|
|
13
|
+
const creator = site.authorX(author);
|
|
14
|
+
return {
|
|
15
|
+
...(site.xSite === undefined ? {} : { site: site.xSite }),
|
|
16
|
+
...(creator === null ? {} : { creator }),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Page metadata for an article. The title and description may carry inline markdown for the
|
|
21
|
+
* reader-facing heading and standfirst; none of it belongs in a document title, a meta
|
|
22
|
+
* description or a social card, so every field takes the stripped string.
|
|
23
|
+
*/
|
|
24
|
+
export function articleMetadata(site, entry, page, lastReviewed) {
|
|
25
|
+
const pagePath = site.page(articlePath(page.section, page.slug));
|
|
26
|
+
const pageUrl = `${site.origin}${pagePath}`;
|
|
27
|
+
const title = stripInlineMarkdown(entry.title);
|
|
28
|
+
const description = entry.description ? stripInlineMarkdown(entry.description) : undefined;
|
|
29
|
+
const modified = lastReviewed ?? entry.updated;
|
|
30
|
+
const socialTitle = fill(site.titleTemplate, title);
|
|
31
|
+
const ogImage = page.ogImage;
|
|
32
|
+
return {
|
|
33
|
+
// A social card has room for the whole headline; a search result does not.
|
|
34
|
+
title: searchTitle(entry.seoTitle ?? title, site.titleTemplate),
|
|
35
|
+
description,
|
|
36
|
+
openGraph: {
|
|
37
|
+
type: "article",
|
|
38
|
+
title: socialTitle,
|
|
39
|
+
description,
|
|
40
|
+
url: pageUrl,
|
|
41
|
+
publishedTime: entry.date.toISOString(),
|
|
42
|
+
modifiedTime: modified?.toISOString(),
|
|
43
|
+
authors: [entry.author],
|
|
44
|
+
images: [{ url: ogImage, width: 1200, height: 630, alt: title, type: "image/png" }],
|
|
45
|
+
},
|
|
46
|
+
twitter: {
|
|
47
|
+
card: "summary_large_image",
|
|
48
|
+
...xAccounts(site, entry.author),
|
|
49
|
+
title: socialTitle,
|
|
50
|
+
description,
|
|
51
|
+
images: [{ url: ogImage, alt: title }],
|
|
52
|
+
},
|
|
53
|
+
// The same page as plain Markdown, for agents; see the `md` route beside each page.
|
|
54
|
+
alternates: { canonical: pageUrl, types: { "text/markdown": `${site.origin}${site.markdownPath(pagePath)}` } },
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/** Anchor of the Questions section; listed in the contents tree like any heading. */
|
|
58
|
+
export const QUESTIONS_ID = "questions";
|
|
59
|
+
export function withQuestions(site, toc, entry) {
|
|
60
|
+
return entry.faqs ? [...toc, { title: site.strings.questions, url: `#${QUESTIONS_ID}`, depth: 2 }] : toc;
|
|
61
|
+
}
|
|
62
|
+
export function articleStructuredData(site, entry, ctx) {
|
|
63
|
+
const headings = entry.toc
|
|
64
|
+
.filter((item) => item.depth === 2)
|
|
65
|
+
.map((item) => ({ text: nodeText(item.title), url: item.url }));
|
|
66
|
+
return articleJsonLd({
|
|
67
|
+
origin: site.origin,
|
|
68
|
+
publisher: site.publisher,
|
|
69
|
+
locale: site.locale,
|
|
70
|
+
homeLabel: site.strings.home,
|
|
71
|
+
pageUrl: ctx.pageUrl,
|
|
72
|
+
type: entry.schemaType ?? "BlogPosting",
|
|
73
|
+
title: stripInlineMarkdown(entry.title),
|
|
74
|
+
description: entry.description ? stripInlineMarkdown(entry.description) : undefined,
|
|
75
|
+
author: entry.author,
|
|
76
|
+
authorUrl: `${site.origin}${site.authorPath(entry.author)}`,
|
|
77
|
+
datePublished: entry.date,
|
|
78
|
+
dateModified: ctx.modified,
|
|
79
|
+
// Article rich results need an image; a page without a hand-made cover has its social card.
|
|
80
|
+
image: entry.image ?? ctx.ogImage,
|
|
81
|
+
section: ctx.section,
|
|
82
|
+
category: postCategory(site, entry.category),
|
|
83
|
+
faqs: entry.faqs?.map((faq) => ({ q: faq.q, a: stripInlineMarkdown(faq.a) })),
|
|
84
|
+
howTo: entry.howTo
|
|
85
|
+
? { name: entry.howTo.name, steps: resolveHowToSteps(entry.howTo.steps, headings, ctx.pageUrl) }
|
|
86
|
+
: undefined,
|
|
87
|
+
itemList: entry.itemList,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=article.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"article.js","sourceRoot":"","sources":["../../src/blog/article.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAoB,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEvF,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAiC,YAAY,EAAE,MAAM,WAAW,CAAC;AAkCxE,sFAAsF;AACtF,MAAM,UAAU,WAAW,CAAC,OAAuB,EAAE,IAAY;IAChE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC;AACrD,CAAC;AAOD,qGAAqG;AACrG,SAAS,SAAS,CAAC,IAAc,EAAE,MAAc;IAChD,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AG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC7E,KAAK,EAAE,KAAK,CAAC,KAAK;YACjB,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE;YAChG,CAAC,CAAC,SAAS;QACZ,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACxB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How the blog's Featured section arranges its posts. The layout is designed for one, two or
|
|
3
|
+
* three posts and nothing else, so the frontmatter schema caps positions at this number.
|
|
4
|
+
*/
|
|
5
|
+
export declare const MAX_FEATURED_POSTS = 3;
|
|
6
|
+
export interface FeaturedLayout<T> {
|
|
7
|
+
/** Full-width split card: cover beside the text. */
|
|
8
|
+
readonly hero: T | undefined;
|
|
9
|
+
/** Equal cards side by side. */
|
|
10
|
+
readonly pair: readonly T[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* One post takes the split hero on its own. Two posts share a row as equals, since a hero plus
|
|
14
|
+
* one card would leave half a row empty. Three posts are the hero with the pair below it, so
|
|
15
|
+
* every row holds cards of one shape and no card is stretched to match a neighbour.
|
|
16
|
+
*/
|
|
17
|
+
export declare function featuredLayout<T>(posts: readonly T[]): FeaturedLayout<T>;
|
|
18
|
+
//# sourceMappingURL=featured.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"featured.d.ts","sourceRoot":"","sources":["../../src/blog/featured.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC,MAAM,WAAW,cAAc,CAAC,CAAC;IAChC,oDAAoD;IACpD,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,SAAS,CAAC;IAC7B,gCAAgC;IAChC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,GAAG,cAAc,CAAC,CAAC,CAAC,CAMxE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How the blog's Featured section arranges its posts. The layout is designed for one, two or
|
|
3
|
+
* three posts and nothing else, so the frontmatter schema caps positions at this number.
|
|
4
|
+
*/
|
|
5
|
+
export const MAX_FEATURED_POSTS = 3;
|
|
6
|
+
/**
|
|
7
|
+
* One post takes the split hero on its own. Two posts share a row as equals, since a hero plus
|
|
8
|
+
* one card would leave half a row empty. Three posts are the hero with the pair below it, so
|
|
9
|
+
* every row holds cards of one shape and no card is stretched to match a neighbour.
|
|
10
|
+
*/
|
|
11
|
+
export function featuredLayout(posts) {
|
|
12
|
+
if (posts.length > MAX_FEATURED_POSTS) {
|
|
13
|
+
throw new Error(`The Featured section holds at most ${MAX_FEATURED_POSTS} posts, got ${posts.length}`);
|
|
14
|
+
}
|
|
15
|
+
if (posts.length === 2)
|
|
16
|
+
return { hero: undefined, pair: posts };
|
|
17
|
+
return { hero: posts[0], pair: posts.slice(1) };
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=featured.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"featured.js","sourceRoot":"","sources":["../../src/blog/featured.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AASpC;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAI,KAAmB;IACpD,IAAI,KAAK,CAAC,MAAM,GAAG,kBAAkB,EAAE,CAAC;QACvC,MAAM,IAAI,KAAK,CAAC,sCAAsC,kBAAkB,eAAe,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IACxG,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IAChE,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AACjD,CAAC"}
|