@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.
Files changed (341) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +59 -2
  3. package/bin/ship-site.js +5 -0
  4. package/dist/badge/badge.d.ts +14 -0
  5. package/dist/badge/badge.d.ts.map +1 -0
  6. package/dist/badge/badge.js +16 -0
  7. package/dist/badge/badge.js.map +1 -0
  8. package/dist/blog/arrow.d.ts +6 -0
  9. package/dist/blog/arrow.d.ts.map +1 -0
  10. package/dist/blog/arrow.js +6 -0
  11. package/dist/blog/arrow.js.map +1 -0
  12. package/dist/blog/article-view.d.ts +20 -0
  13. package/dist/blog/article-view.d.ts.map +1 -0
  14. package/dist/blog/article-view.js +71 -0
  15. package/dist/blog/article-view.js.map +1 -0
  16. package/dist/blog/article.d.ts +72 -0
  17. package/dist/blog/article.d.ts.map +1 -0
  18. package/dist/blog/article.js +90 -0
  19. package/dist/blog/article.js.map +1 -0
  20. package/dist/blog/featured.d.ts +18 -0
  21. package/dist/blog/featured.d.ts.map +1 -0
  22. package/dist/blog/featured.js +19 -0
  23. package/dist/blog/featured.js.map +1 -0
  24. package/dist/blog/frontmatter.d.ts +155 -0
  25. package/dist/blog/frontmatter.d.ts.map +1 -0
  26. package/dist/blog/frontmatter.js +96 -0
  27. package/dist/blog/frontmatter.js.map +1 -0
  28. package/dist/blog/index-view.d.ts +21 -0
  29. package/dist/blog/index-view.d.ts.map +1 -0
  30. package/dist/blog/index-view.js +70 -0
  31. package/dist/blog/index-view.js.map +1 -0
  32. package/dist/blog/inline-markdown.d.ts +15 -0
  33. package/dist/blog/inline-markdown.d.ts.map +1 -0
  34. package/dist/blog/inline-markdown.js +44 -0
  35. package/dist/blog/inline-markdown.js.map +1 -0
  36. package/dist/blog/post-card.d.ts +37 -0
  37. package/dist/blog/post-card.d.ts.map +1 -0
  38. package/dist/blog/post-card.js +68 -0
  39. package/dist/blog/post-card.js.map +1 -0
  40. package/dist/blog/site.d.ts +57 -0
  41. package/dist/blog/site.d.ts.map +1 -0
  42. package/dist/blog/site.js +76 -0
  43. package/dist/blog/site.js.map +1 -0
  44. package/dist/blog/toc.d.ts +29 -0
  45. package/dist/blog/toc.d.ts.map +1 -0
  46. package/dist/blog/toc.js +42 -0
  47. package/dist/blog/toc.js.map +1 -0
  48. package/dist/config/context.d.ts +16 -0
  49. package/dist/config/context.d.ts.map +1 -0
  50. package/dist/config/context.js +11 -0
  51. package/dist/config/context.js.map +1 -0
  52. package/dist/config/identity.d.ts +41 -0
  53. package/dist/config/identity.d.ts.map +1 -0
  54. package/dist/config/identity.js +28 -0
  55. package/dist/config/identity.js.map +1 -0
  56. package/dist/config/json-schema.d.ts +11 -0
  57. package/dist/config/json-schema.d.ts.map +1 -0
  58. package/dist/config/json-schema.js +14 -0
  59. package/dist/config/json-schema.js.map +1 -0
  60. package/dist/config/site-config.d.ts +145 -0
  61. package/dist/config/site-config.d.ts.map +1 -0
  62. package/dist/config/site-config.js +130 -0
  63. package/dist/config/site-config.js.map +1 -0
  64. package/dist/docs/page-view.d.ts +21 -0
  65. package/dist/docs/page-view.d.ts.map +1 -0
  66. package/dist/docs/page-view.js +27 -0
  67. package/dist/docs/page-view.js.map +1 -0
  68. package/dist/feeds/feeds.d.ts +33 -0
  69. package/dist/feeds/feeds.d.ts.map +1 -0
  70. package/dist/feeds/feeds.js +122 -0
  71. package/dist/feeds/feeds.js.map +1 -0
  72. package/dist/format/dates.d.ts +5 -0
  73. package/dist/format/dates.d.ts.map +1 -0
  74. package/dist/format/dates.js +17 -0
  75. package/dist/format/dates.js.map +1 -0
  76. package/dist/format/node-text.d.ts +7 -0
  77. package/dist/format/node-text.d.ts.map +1 -0
  78. package/dist/format/node-text.js +15 -0
  79. package/dist/format/node-text.js.map +1 -0
  80. package/dist/format/toc-depth.d.ts +11 -0
  81. package/dist/format/toc-depth.d.ts.map +1 -0
  82. package/dist/format/toc-depth.js +14 -0
  83. package/dist/format/toc-depth.js.map +1 -0
  84. package/dist/i18n/fumadocs-keys.d.ts +13 -0
  85. package/dist/i18n/fumadocs-keys.d.ts.map +1 -0
  86. package/dist/i18n/fumadocs-keys.js +136 -0
  87. package/dist/i18n/fumadocs-keys.js.map +1 -0
  88. package/dist/i18n/strings.d.ts +19 -0
  89. package/dist/i18n/strings.d.ts.map +1 -0
  90. package/dist/i18n/strings.js +59 -0
  91. package/dist/i18n/strings.js.map +1 -0
  92. package/dist/i18n/tables/de.d.ts +3 -0
  93. package/dist/i18n/tables/de.d.ts.map +1 -0
  94. package/dist/i18n/tables/de.js +82 -0
  95. package/dist/i18n/tables/de.js.map +1 -0
  96. package/dist/i18n/tables/en.d.ts +3 -0
  97. package/dist/i18n/tables/en.d.ts.map +1 -0
  98. package/dist/i18n/tables/en.js +25 -0
  99. package/dist/i18n/tables/en.js.map +1 -0
  100. package/dist/i18n/tables/es.d.ts +3 -0
  101. package/dist/i18n/tables/es.d.ts.map +1 -0
  102. package/dist/i18n/tables/es.js +82 -0
  103. package/dist/i18n/tables/es.js.map +1 -0
  104. package/dist/i18n/tables/fr.d.ts +3 -0
  105. package/dist/i18n/tables/fr.d.ts.map +1 -0
  106. package/dist/i18n/tables/fr.js +82 -0
  107. package/dist/i18n/tables/fr.js.map +1 -0
  108. package/dist/i18n/tables/nl.d.ts +3 -0
  109. package/dist/i18n/tables/nl.d.ts.map +1 -0
  110. package/dist/i18n/tables/nl.js +82 -0
  111. package/dist/i18n/tables/nl.js.map +1 -0
  112. package/dist/i18n/tables/pt.d.ts +3 -0
  113. package/dist/i18n/tables/pt.d.ts.map +1 -0
  114. package/dist/i18n/tables/pt.js +82 -0
  115. package/dist/i18n/tables/pt.js.map +1 -0
  116. package/dist/i18n/tables/tr.d.ts +3 -0
  117. package/dist/i18n/tables/tr.d.ts.map +1 -0
  118. package/dist/i18n/tables/tr.js +82 -0
  119. package/dist/i18n/tables/tr.js.map +1 -0
  120. package/dist/i18n/types.d.ts +39 -0
  121. package/dist/i18n/types.d.ts.map +1 -0
  122. package/dist/i18n/types.js +2 -0
  123. package/dist/i18n/types.js.map +1 -0
  124. package/dist/layout/analytics.d.ts +9 -0
  125. package/dist/layout/analytics.d.ts.map +1 -0
  126. package/dist/layout/analytics.js +18 -0
  127. package/dist/layout/analytics.js.map +1 -0
  128. package/dist/layout/brand-files.d.ts +15 -0
  129. package/dist/layout/brand-files.d.ts.map +1 -0
  130. package/dist/layout/brand-files.js +15 -0
  131. package/dist/layout/brand-files.js.map +1 -0
  132. package/dist/layout/footer.d.ts +10 -0
  133. package/dist/layout/footer.d.ts.map +1 -0
  134. package/dist/layout/footer.js +21 -0
  135. package/dist/layout/footer.js.map +1 -0
  136. package/dist/layout/not-found.d.ts +7 -0
  137. package/dist/layout/not-found.d.ts.map +1 -0
  138. package/dist/layout/not-found.js +8 -0
  139. package/dist/layout/not-found.js.map +1 -0
  140. package/dist/layout/provider.d.ts +17 -0
  141. package/dist/layout/provider.d.ts.map +1 -0
  142. package/dist/layout/provider.js +14 -0
  143. package/dist/layout/provider.js.map +1 -0
  144. package/dist/layout/root.d.ts +17 -0
  145. package/dist/layout/root.d.ts.map +1 -0
  146. package/dist/layout/root.js +47 -0
  147. package/dist/layout/root.js.map +1 -0
  148. package/dist/lint/source.d.ts +19 -0
  149. package/dist/lint/source.d.ts.map +1 -0
  150. package/dist/lint/source.js +43 -0
  151. package/dist/lint/source.js.map +1 -0
  152. package/dist/llms/llms.d.ts +22 -0
  153. package/dist/llms/llms.d.ts.map +1 -0
  154. package/dist/llms/llms.js +24 -0
  155. package/dist/llms/llms.js.map +1 -0
  156. package/dist/markdown/article.d.ts +44 -0
  157. package/dist/markdown/article.d.ts.map +1 -0
  158. package/dist/markdown/article.js +108 -0
  159. package/dist/markdown/article.js.map +1 -0
  160. package/dist/markdown/inline.d.ts +40 -0
  161. package/dist/markdown/inline.d.ts.map +1 -0
  162. package/dist/markdown/inline.js +74 -0
  163. package/dist/markdown/inline.js.map +1 -0
  164. package/dist/markdown/page.d.ts +13 -0
  165. package/dist/markdown/page.d.ts.map +1 -0
  166. package/dist/markdown/page.js +21 -0
  167. package/dist/markdown/page.js.map +1 -0
  168. package/dist/marker.d.ts +37 -0
  169. package/dist/marker.d.ts.map +1 -0
  170. package/dist/marker.js +36 -0
  171. package/dist/marker.js.map +1 -0
  172. package/dist/mdx/allow-list.d.ts +23 -0
  173. package/dist/mdx/allow-list.d.ts.map +1 -0
  174. package/dist/mdx/allow-list.js +79 -0
  175. package/dist/mdx/allow-list.js.map +1 -0
  176. package/dist/mdx/components.d.ts +8 -0
  177. package/dist/mdx/components.d.ts.map +1 -0
  178. package/dist/mdx/components.js +68 -0
  179. package/dist/mdx/components.js.map +1 -0
  180. package/dist/mdx/remark-alerts.d.ts +4 -0
  181. package/dist/mdx/remark-alerts.d.ts.map +1 -0
  182. package/dist/mdx/remark-alerts.js +39 -0
  183. package/dist/mdx/remark-alerts.js.map +1 -0
  184. package/dist/next.d.ts +24 -0
  185. package/dist/next.d.ts.map +1 -0
  186. package/dist/next.js +55 -0
  187. package/dist/next.js.map +1 -0
  188. package/dist/node/bin.d.ts +3 -0
  189. package/dist/node/bin.d.ts.map +1 -0
  190. package/dist/node/bin.js +13 -0
  191. package/dist/node/bin.js.map +1 -0
  192. package/dist/node/brand.d.ts +13 -0
  193. package/dist/node/brand.d.ts.map +1 -0
  194. package/dist/node/brand.js +48 -0
  195. package/dist/node/brand.js.map +1 -0
  196. package/dist/node/build.d.ts +20 -0
  197. package/dist/node/build.d.ts.map +1 -0
  198. package/dist/node/build.js +133 -0
  199. package/dist/node/build.js.map +1 -0
  200. package/dist/node/cli.d.ts +11 -0
  201. package/dist/node/cli.d.ts.map +1 -0
  202. package/dist/node/cli.js +80 -0
  203. package/dist/node/cli.js.map +1 -0
  204. package/dist/node/config-file.d.ts +5 -0
  205. package/dist/node/config-file.d.ts.map +1 -0
  206. package/dist/node/config-file.js +31 -0
  207. package/dist/node/config-file.js.map +1 -0
  208. package/dist/node/content.d.ts +6 -0
  209. package/dist/node/content.d.ts.map +1 -0
  210. package/dist/node/content.js +36 -0
  211. package/dist/node/content.js.map +1 -0
  212. package/dist/node/errors.d.ts +26 -0
  213. package/dist/node/errors.d.ts.map +1 -0
  214. package/dist/node/errors.js +34 -0
  215. package/dist/node/errors.js.map +1 -0
  216. package/dist/node/files.d.ts +12 -0
  217. package/dist/node/files.d.ts.map +1 -0
  218. package/dist/node/files.js +43 -0
  219. package/dist/node/files.js.map +1 -0
  220. package/dist/node/marker.d.ts +24 -0
  221. package/dist/node/marker.d.ts.map +1 -0
  222. package/dist/node/marker.js +22 -0
  223. package/dist/node/marker.js.map +1 -0
  224. package/dist/node/og.d.ts +17 -0
  225. package/dist/node/og.d.ts.map +1 -0
  226. package/dist/node/og.js +43 -0
  227. package/dist/node/og.js.map +1 -0
  228. package/dist/node/project-root.d.ts +12 -0
  229. package/dist/node/project-root.d.ts.map +1 -0
  230. package/dist/node/project-root.js +27 -0
  231. package/dist/node/project-root.js.map +1 -0
  232. package/dist/node/serve.d.ts +32 -0
  233. package/dist/node/serve.d.ts.map +1 -0
  234. package/dist/node/serve.js +133 -0
  235. package/dist/node/serve.js.map +1 -0
  236. package/dist/node/theme.d.ts +15 -0
  237. package/dist/node/theme.d.ts.map +1 -0
  238. package/dist/node/theme.js +46 -0
  239. package/dist/node/theme.js.map +1 -0
  240. package/dist/search/dialog.d.ts +14 -0
  241. package/dist/search/dialog.d.ts.map +1 -0
  242. package/dist/search/dialog.js +17 -0
  243. package/dist/search/dialog.js.map +1 -0
  244. package/dist/search/language.d.ts +8 -0
  245. package/dist/search/language.d.ts.map +1 -0
  246. package/dist/search/language.js +30 -0
  247. package/dist/search/language.js.map +1 -0
  248. package/dist/search/route.d.ts +9 -0
  249. package/dist/search/route.d.ts.map +1 -0
  250. package/dist/search/route.js +11 -0
  251. package/dist/search/route.js.map +1 -0
  252. package/dist/seo/article.d.ts +84 -0
  253. package/dist/seo/article.d.ts.map +1 -0
  254. package/dist/seo/article.js +117 -0
  255. package/dist/seo/article.js.map +1 -0
  256. package/dist/seo/collection.d.ts +19 -0
  257. package/dist/seo/collection.d.ts.map +1 -0
  258. package/dist/seo/collection.js +30 -0
  259. package/dist/seo/collection.js.map +1 -0
  260. package/dist/seo/dataset.d.ts +31 -0
  261. package/dist/seo/dataset.d.ts.map +1 -0
  262. package/dist/seo/dataset.js +33 -0
  263. package/dist/seo/dataset.js.map +1 -0
  264. package/dist/seo/json-ld.d.ts +6 -0
  265. package/dist/seo/json-ld.d.ts.map +1 -0
  266. package/dist/seo/json-ld.js +8 -0
  267. package/dist/seo/json-ld.js.map +1 -0
  268. package/dist/seo/script-json.d.ts +8 -0
  269. package/dist/seo/script-json.d.ts.map +1 -0
  270. package/dist/seo/script-json.js +12 -0
  271. package/dist/seo/script-json.js.map +1 -0
  272. package/dist/seo/title.d.ts +11 -0
  273. package/dist/seo/title.d.ts.map +1 -0
  274. package/dist/seo/title.js +11 -0
  275. package/dist/seo/title.js.map +1 -0
  276. package/dist/seo/x-handle.d.ts +9 -0
  277. package/dist/seo/x-handle.d.ts.map +1 -0
  278. package/dist/seo/x-handle.js +21 -0
  279. package/dist/seo/x-handle.js.map +1 -0
  280. package/dist/site/app.d.ts +56 -0
  281. package/dist/site/app.d.ts.map +1 -0
  282. package/dist/site/app.js +79 -0
  283. package/dist/site/app.js.map +1 -0
  284. package/dist/site/features.d.ts +26 -0
  285. package/dist/site/features.d.ts.map +1 -0
  286. package/dist/site/features.js +46 -0
  287. package/dist/site/features.js.map +1 -0
  288. package/dist/site/metadata.d.ts +6 -0
  289. package/dist/site/metadata.d.ts.map +1 -0
  290. package/dist/site/metadata.js +78 -0
  291. package/dist/site/metadata.js.map +1 -0
  292. package/dist/site/outputs.d.ts +24 -0
  293. package/dist/site/outputs.d.ts.map +1 -0
  294. package/dist/site/outputs.js +113 -0
  295. package/dist/site/outputs.js.map +1 -0
  296. package/dist/site/posts.d.ts +6 -0
  297. package/dist/site/posts.d.ts.map +1 -0
  298. package/dist/site/posts.js +9 -0
  299. package/dist/site/posts.js.map +1 -0
  300. package/dist/site/routes.d.ts +43 -0
  301. package/dist/site/routes.d.ts.map +1 -0
  302. package/dist/site/routes.js +94 -0
  303. package/dist/site/routes.js.map +1 -0
  304. package/dist/site/site-page.d.ts +11 -0
  305. package/dist/site/site-page.d.ts.map +1 -0
  306. package/dist/site/site-page.js +70 -0
  307. package/dist/site/site-page.js.map +1 -0
  308. package/dist/site/sources.d.ts +58 -0
  309. package/dist/site/sources.d.ts.map +1 -0
  310. package/dist/site/sources.js +2 -0
  311. package/dist/site/sources.js.map +1 -0
  312. package/dist/site/url-style.d.ts +21 -0
  313. package/dist/site/url-style.d.ts.map +1 -0
  314. package/dist/site/url-style.js +18 -0
  315. package/dist/site/url-style.js.map +1 -0
  316. package/dist/website/blocks/commerce.d.ts +41 -0
  317. package/dist/website/blocks/commerce.d.ts.map +1 -0
  318. package/dist/website/blocks/commerce.js +26 -0
  319. package/dist/website/blocks/commerce.js.map +1 -0
  320. package/dist/website/blocks/content.d.ts +41 -0
  321. package/dist/website/blocks/content.d.ts.map +1 -0
  322. package/dist/website/blocks/content.js +25 -0
  323. package/dist/website/blocks/content.js.map +1 -0
  324. package/dist/website/blocks/marketing.d.ts +32 -0
  325. package/dist/website/blocks/marketing.d.ts.map +1 -0
  326. package/dist/website/blocks/marketing.js +23 -0
  327. package/dist/website/blocks/marketing.js.map +1 -0
  328. package/dist/website/blocks/parts.d.ts +26 -0
  329. package/dist/website/blocks/parts.d.ts.map +1 -0
  330. package/dist/website/blocks/parts.js +13 -0
  331. package/dist/website/blocks/parts.js.map +1 -0
  332. package/dist/website/page-view.d.ts +12 -0
  333. package/dist/website/page-view.d.ts.map +1 -0
  334. package/dist/website/page-view.js +10 -0
  335. package/dist/website/page-view.js.map +1 -0
  336. package/dist/zod.d.ts +8 -0
  337. package/dist/zod.d.ts.map +1 -0
  338. package/dist/zod.js +8 -0
  339. package/dist/zod.js.map +1 -0
  340. package/package.json +187 -3
  341. package/styles.css +326 -0
@@ -0,0 +1,155 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Frontmatter every article shares, a blog post or any other article page. The fields after
4
+ * `dataset` exist for search and answer engines: each is rendered on the page AND mirrored into
5
+ * structured data from the same value, so the markup can never claim something the reader does
6
+ * not see. A site's content collection uses these, so the content tests check against the exact
7
+ * schema the site builds with.
8
+ */
9
+ export declare const articleFields: {
10
+ title: z.ZodString;
11
+ /**
12
+ * The document title, when the headline runs past the roughly 60 characters a search result
13
+ * shows. The page heading, social card and structured data keep the full `title`.
14
+ */
15
+ seoTitle: z.ZodOptional<z.ZodString>;
16
+ description: z.ZodOptional<z.ZodString>;
17
+ author: z.ZodString;
18
+ date: z.ZodCoercedDate<unknown>;
19
+ /** Set only when the content materially changes, so freshness signals stay truthful. */
20
+ updated: z.ZodOptional<z.ZodCoercedDate<unknown>>;
21
+ image: z.ZodOptional<z.ZodString>;
22
+ imageAlt: z.ZodOptional<z.ZodString>;
23
+ draft: z.ZodOptional<z.ZodBoolean>;
24
+ /**
25
+ * Deepest heading level the contents tree lists. 2 shows only the top-level sections, 3 adds
26
+ * their subsections, and so on. Absent means show every heading.
27
+ */
28
+ tocDepth: z.ZodOptional<z.ZodNumber>;
29
+ /**
30
+ * Present on posts that publish their underlying data. Emits schema.org Dataset markup that
31
+ * points at the file, which makes a study discoverable in dataset search, a surface a
32
+ * rendered table cannot reach.
33
+ */
34
+ dataset: z.ZodOptional<z.ZodObject<{
35
+ name: z.ZodString;
36
+ description: z.ZodString;
37
+ path: z.ZodString;
38
+ encodingFormat: z.ZodDefault<z.ZodString>;
39
+ variables: z.ZodArray<z.ZodString>;
40
+ license: z.ZodOptional<z.ZodString>;
41
+ }, z.core.$strip>>;
42
+ /** `TechArticle` for guides and definitions; absent keeps `BlogPosting`, right for essays and studies. */
43
+ schemaType: z.ZodOptional<z.ZodEnum<{
44
+ BlogPosting: "BlogPosting";
45
+ TechArticle: "TechArticle";
46
+ }>>;
47
+ /** Rendered as the closing Questions section AND mirrored into FAQPage. */
48
+ faqs: z.ZodOptional<z.ZodArray<z.ZodObject<{
49
+ q: z.ZodString;
50
+ a: z.ZodString;
51
+ }, z.core.$strip>>>;
52
+ /**
53
+ * A guide's steps, mirrored into HowTo. Each step names the H2 that carries it by its exact
54
+ * heading text, so the markup points at content the reader can see; a step whose heading is
55
+ * missing fails the static build.
56
+ */
57
+ howTo: z.ZodOptional<z.ZodObject<{
58
+ name: z.ZodString;
59
+ steps: z.ZodArray<z.ZodObject<{
60
+ heading: z.ZodString;
61
+ text: z.ZodString;
62
+ }, z.core.$strip>>;
63
+ }, z.core.$strip>>;
64
+ /** A ranked list the page shows as a table, mirrored into ItemList in the same order. */
65
+ itemList: z.ZodOptional<z.ZodObject<{
66
+ name: z.ZodString;
67
+ items: z.ZodArray<z.ZodObject<{
68
+ name: z.ZodString;
69
+ url: z.ZodOptional<z.ZodString>;
70
+ }, z.core.$strip>>;
71
+ }, z.core.$strip>>;
72
+ };
73
+ /** The fields a blog post adds: its category, by a slug the site config lists, and its featured place. */
74
+ export declare function postFields<const Slugs extends readonly [string, ...string[]]>(categorySlugs: Slugs): {
75
+ /** Which tab the post lists under on the blog index. */
76
+ category: z.ZodEnum<{ [k_1 in Slugs[number]]: k_1; } extends infer T ? { [k in keyof T]: T[k]; } : never>;
77
+ /**
78
+ * Position in the Featured section at the top of the index, 1 first. Absent means the post
79
+ * is not featured. The section's layout is built for three at most (featured.ts).
80
+ */
81
+ featured: z.ZodOptional<z.ZodNumber>;
82
+ title: z.ZodString;
83
+ /**
84
+ * The document title, when the headline runs past the roughly 60 characters a search result
85
+ * shows. The page heading, social card and structured data keep the full `title`.
86
+ */
87
+ seoTitle: z.ZodOptional<z.ZodString>;
88
+ description: z.ZodOptional<z.ZodString>;
89
+ author: z.ZodString;
90
+ date: z.ZodCoercedDate<unknown>;
91
+ /** Set only when the content materially changes, so freshness signals stay truthful. */
92
+ updated: z.ZodOptional<z.ZodCoercedDate<unknown>>;
93
+ image: z.ZodOptional<z.ZodString>;
94
+ imageAlt: z.ZodOptional<z.ZodString>;
95
+ draft: z.ZodOptional<z.ZodBoolean>;
96
+ /**
97
+ * Deepest heading level the contents tree lists. 2 shows only the top-level sections, 3 adds
98
+ * their subsections, and so on. Absent means show every heading.
99
+ */
100
+ tocDepth: z.ZodOptional<z.ZodNumber>;
101
+ /**
102
+ * Present on posts that publish their underlying data. Emits schema.org Dataset markup that
103
+ * points at the file, which makes a study discoverable in dataset search, a surface a
104
+ * rendered table cannot reach.
105
+ */
106
+ dataset: z.ZodOptional<z.ZodObject<{
107
+ name: z.ZodString;
108
+ description: z.ZodString;
109
+ path: z.ZodString;
110
+ encodingFormat: z.ZodDefault<z.ZodString>;
111
+ variables: z.ZodArray<z.ZodString>;
112
+ license: z.ZodOptional<z.ZodString>;
113
+ }, z.core.$strip>>;
114
+ /** `TechArticle` for guides and definitions; absent keeps `BlogPosting`, right for essays and studies. */
115
+ schemaType: z.ZodOptional<z.ZodEnum<{
116
+ BlogPosting: "BlogPosting";
117
+ TechArticle: "TechArticle";
118
+ }>>;
119
+ /** Rendered as the closing Questions section AND mirrored into FAQPage. */
120
+ faqs: z.ZodOptional<z.ZodArray<z.ZodObject<{
121
+ q: z.ZodString;
122
+ a: z.ZodString;
123
+ }, z.core.$strip>>>;
124
+ /**
125
+ * A guide's steps, mirrored into HowTo. Each step names the H2 that carries it by its exact
126
+ * heading text, so the markup points at content the reader can see; a step whose heading is
127
+ * missing fails the static build.
128
+ */
129
+ howTo: z.ZodOptional<z.ZodObject<{
130
+ name: z.ZodString;
131
+ steps: z.ZodArray<z.ZodObject<{
132
+ heading: z.ZodString;
133
+ text: z.ZodString;
134
+ }, z.core.$strip>>;
135
+ }, z.core.$strip>>;
136
+ /** A ranked list the page shows as a table, mirrored into ItemList in the same order. */
137
+ itemList: z.ZodOptional<z.ZodObject<{
138
+ name: z.ZodString;
139
+ items: z.ZodArray<z.ZodObject<{
140
+ name: z.ZodString;
141
+ url: z.ZodOptional<z.ZodString>;
142
+ }, z.core.$strip>>;
143
+ }, z.core.$strip>>;
144
+ };
145
+ /** A website page's frontmatter: the page's own title and summary; its content is blocks. */
146
+ export declare const pageFields: {
147
+ title: z.ZodString;
148
+ description: z.ZodOptional<z.ZodString>;
149
+ };
150
+ /** A docs page's frontmatter: its title and summary. The sidebar order comes from `meta.json`. */
151
+ export declare const docsFields: {
152
+ title: z.ZodString;
153
+ description: z.ZodOptional<z.ZodString>;
154
+ };
155
+ //# sourceMappingURL=frontmatter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontmatter.d.ts","sourceRoot":"","sources":["../../src/blog/frontmatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;GAMG;AACH,eAAO,MAAM,aAAa;;IAEzB;;;OAGG;;;;;IAKH,wFAAwF;;;;;IAKxF;;;OAGG;;IAEH;;;;OAIG;;;;;;;;;IAaH,0GAA0G;;;;;IAE1G,2EAA2E;;;;;IAK3E;;;;OAIG;;;;;;;;IAOH,yFAAyF;;;;;;;;CAOzF,CAAC;AAEF,0GAA0G;AAC1G,wBAAgB,UAAU,CAAC,KAAK,CAAC,KAAK,SAAS,SAAS,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,EAAE,aAAa,EAAE,KAAK;IAGjG,wDAAwD;;IAExD;;;OAGG;;;IAvEJ;;;OAGG;;;;;IAKH,wFAAwF;;;;;IAKxF;;;OAGG;;IAEH;;;;OAIG;;;;;;;;;IAaH,0GAA0G;;;;;IAE1G,2EAA2E;;;;;IAK3E;;;;OAIG;;;;;;;;IAOH,yFAAyF;;;;;;;;EAqBzF;AAED,6FAA6F;AAC7F,eAAO,MAAM,UAAU;;;CAGtB,CAAC;AAEF,kGAAkG;AAClG,eAAO,MAAM,UAAU;;;CAGtB,CAAC"}
@@ -0,0 +1,96 @@
1
+ import { z } from "zod";
2
+ import { MAX_FEATURED_POSTS } from "./featured.js";
3
+ /**
4
+ * Frontmatter every article shares, a blog post or any other article page. The fields after
5
+ * `dataset` exist for search and answer engines: each is rendered on the page AND mirrored into
6
+ * structured data from the same value, so the markup can never claim something the reader does
7
+ * not see. A site's content collection uses these, so the content tests check against the exact
8
+ * schema the site builds with.
9
+ */
10
+ export const articleFields = {
11
+ title: z.string(),
12
+ /**
13
+ * The document title, when the headline runs past the roughly 60 characters a search result
14
+ * shows. The page heading, social card and structured data keep the full `title`.
15
+ */
16
+ seoTitle: z.string().max(60).optional(),
17
+ description: z.string().optional(),
18
+ author: z.string(),
19
+ date: z.coerce.date(),
20
+ /** Set only when the content materially changes, so freshness signals stay truthful. */
21
+ updated: z.coerce.date().optional(),
22
+ image: z.string().optional(),
23
+ imageAlt: z.string().optional(),
24
+ draft: z.boolean().optional(),
25
+ /**
26
+ * Deepest heading level the contents tree lists. 2 shows only the top-level sections, 3 adds
27
+ * their subsections, and so on. Absent means show every heading.
28
+ */
29
+ tocDepth: z.number().int().min(1).max(6).optional(),
30
+ /**
31
+ * Present on posts that publish their underlying data. Emits schema.org Dataset markup that
32
+ * points at the file, which makes a study discoverable in dataset search, a surface a
33
+ * rendered table cannot reach.
34
+ */
35
+ dataset: z
36
+ .object({
37
+ name: z.string(),
38
+ description: z.string(),
39
+ /** Site-relative path to the file, e.g. /data/thing.csv */
40
+ path: z.string().startsWith("/"),
41
+ encodingFormat: z.string().default("text/csv"),
42
+ /** Column meanings, mirrored into variableMeasured. */
43
+ variables: z.array(z.string()).min(1),
44
+ license: z.string().optional(),
45
+ })
46
+ .optional(),
47
+ /** `TechArticle` for guides and definitions; absent keeps `BlogPosting`, right for essays and studies. */
48
+ schemaType: z.enum(["BlogPosting", "TechArticle"]).optional(),
49
+ /** Rendered as the closing Questions section AND mirrored into FAQPage. */
50
+ faqs: z
51
+ .array(z.object({ q: z.string(), a: z.string() }))
52
+ .min(2)
53
+ .optional(),
54
+ /**
55
+ * A guide's steps, mirrored into HowTo. Each step names the H2 that carries it by its exact
56
+ * heading text, so the markup points at content the reader can see; a step whose heading is
57
+ * missing fails the static build.
58
+ */
59
+ howTo: z
60
+ .object({
61
+ name: z.string(),
62
+ steps: z.array(z.object({ heading: z.string(), text: z.string() })).min(2),
63
+ })
64
+ .optional(),
65
+ /** A ranked list the page shows as a table, mirrored into ItemList in the same order. */
66
+ itemList: z
67
+ .object({
68
+ name: z.string(),
69
+ items: z.array(z.object({ name: z.string(), url: z.string().optional() })).min(2),
70
+ })
71
+ .optional(),
72
+ };
73
+ /** The fields a blog post adds: its category, by a slug the site config lists, and its featured place. */
74
+ export function postFields(categorySlugs) {
75
+ return {
76
+ ...articleFields,
77
+ /** Which tab the post lists under on the blog index. */
78
+ category: z.enum(categorySlugs),
79
+ /**
80
+ * Position in the Featured section at the top of the index, 1 first. Absent means the post
81
+ * is not featured. The section's layout is built for three at most (featured.ts).
82
+ */
83
+ featured: z.number().int().min(1).max(MAX_FEATURED_POSTS).optional(),
84
+ };
85
+ }
86
+ /** A website page's frontmatter: the page's own title and summary; its content is blocks. */
87
+ export const pageFields = {
88
+ title: z.string(),
89
+ description: z.string().optional(),
90
+ };
91
+ /** A docs page's frontmatter: its title and summary. The sidebar order comes from `meta.json`. */
92
+ export const docsFields = {
93
+ title: z.string(),
94
+ description: z.string().optional(),
95
+ };
96
+ //# sourceMappingURL=frontmatter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontmatter.js","sourceRoot":"","sources":["../../src/blog/frontmatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC5B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB;;;OAGG;IACH,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC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ACH,CAAC;AAED,6FAA6F;AAC7F,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC;AAEF,kGAAkG;AAClG,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { ReactElement } from "react";
2
+ import { type PostSummary } from "./post-card.js";
3
+ import type { BlogSite, NamedPath } from "./site.js";
4
+ export interface BlogIndexViewProps {
5
+ readonly site: BlogSite;
6
+ readonly heading: string;
7
+ readonly subtitle: string;
8
+ readonly path: string;
9
+ /** The categories that have a post, in config order: a tab with no post would be a dead page. */
10
+ readonly categories: ReadonlyArray<NamedPath & {
11
+ readonly slug: string;
12
+ }>;
13
+ /** The category being shown, or null for all posts. */
14
+ readonly activeCategory: string | null;
15
+ /** Shown above the list on the all-posts view only, and left out of the list below it. */
16
+ readonly featured: ReadonlyArray<PostSummary>;
17
+ readonly posts: ReadonlyArray<PostSummary>;
18
+ }
19
+ /** Shows the label of every section, so a category page never jumps from its h1 to the cards' h3s. */
20
+ export declare function BlogIndexView(props: BlogIndexViewProps): ReactElement;
21
+ //# sourceMappingURL=index-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-view.d.ts","sourceRoot":"","sources":["../../src/blog/index-view.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAM1C,OAAO,EAAmC,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAkErD,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,iGAAiG;IACjG,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,SAAS,GAAG;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC1E,uDAAuD;IACvD,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,0FAA0F;IAC1F,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IAC9C,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;CAC3C;AAwED,sGAAsG;AACtG,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,YAAY,CAwBrE"}
@@ -0,0 +1,70 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import Link from "next/link";
3
+ import { fill } from "../i18n/strings.js";
4
+ import { stripInlineMarkdown } from "../markdown/inline.js";
5
+ import { collectionJsonLd } from "../seo/collection.js";
6
+ import { JsonLd } from "../seo/json-ld.js";
7
+ import { featuredLayout } from "./featured.js";
8
+ import { PostCard, PostHeroCard, PostRow } from "./post-card.js";
9
+ function FeaturedPosts({ site, posts }) {
10
+ const { hero, pair } = featuredLayout(posts);
11
+ return (_jsxs("div", { className: "flex flex-col gap-6", children: [hero ? _jsx(PostHeroCard, { site: site, post: hero }) : null, pair.length > 0 ? (_jsx("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: pair.map((post, index) => (_jsx(PostCard, { site: site, post: post, size: "feature", priority: !hero && index === 0 }, post.slug))) })) : null] }));
12
+ }
13
+ /** The eyebrow label, as a real heading for the section. */
14
+ function SectionLabel({ children, id }) {
15
+ return (_jsxs("h2", { id: id, className: "site-eyebrow", children: [_jsx("span", { className: "site-eyebrow-dot" }), children] }));
16
+ }
17
+ /**
18
+ * Category tabs. Each is a real link to a statically generated route, so a crawler follows them
19
+ * and each category has its own URL, title and description.
20
+ */
21
+ function CategoryTabs({ site, categories, active, }) {
22
+ const tabs = [
23
+ { name: site.strings.allPosts, href: site.blogPath, slug: null },
24
+ ...categories.map((c) => ({ name: c.name, href: c.path, slug: c.slug })),
25
+ ];
26
+ return (_jsx("nav", { "aria-label": site.strings.blogCategories, className: "mb-12", children: _jsx("div", { className: "flex flex-wrap gap-2", children: tabs.map((tab) => {
27
+ const isActive = tab.slug === active;
28
+ return (_jsx(Link, { href: tab.href, className: isActive ? "site-chip site-chip-active" : "site-chip", "aria-current": isActive ? "page" : undefined, children: tab.name }, tab.href));
29
+ }) }) }));
30
+ }
31
+ function indexJsonLd(props, listed) {
32
+ const { site, heading, subtitle, path, activeCategory } = props;
33
+ const collection = fill(site.strings.blogCollection, site.publisher);
34
+ return collectionJsonLd({
35
+ name: activeCategory ? `${heading} ${site.titleSeparator} ${collection}` : collection,
36
+ description: subtitle,
37
+ url: `${site.origin}${path}`,
38
+ items: listed.map((post) => ({
39
+ name: stripInlineMarkdown(post.title),
40
+ url: `${site.origin}${site.postPath(post.slug)}`,
41
+ })),
42
+ breadcrumbs: [
43
+ { name: site.strings.home, url: `${site.origin}/` },
44
+ // A blog at the site root is the home page, so it gets no crumb of its own.
45
+ ...(site.blogPath === "/" ? [] : [{ name: site.strings.blog, url: `${site.origin}${site.blogPath}` }]),
46
+ ...(activeCategory ? [{ name: heading, url: `${site.origin}${path}` }] : []),
47
+ ],
48
+ });
49
+ }
50
+ /** The magazine: featured posts as a hero and a pair, then the rest as a grid of cards. */
51
+ function Magazine({ site, featured, rest }) {
52
+ return (_jsxs(_Fragment, { children: [featured.length > 0 ? (_jsxs("section", { "aria-labelledby": "featured", className: "mb-16", children: [_jsx(SectionLabel, { id: "featured", children: site.strings.featured }), _jsx(FeaturedPosts, { site: site, posts: featured })] })) : null, rest.length > 0 ? _jsx(LatestGrid, { site: site, posts: rest }) : null] }));
53
+ }
54
+ function LatestGrid({ site, posts }) {
55
+ return (_jsxs("section", { "aria-labelledby": "latest", className: "mb-16", children: [_jsx(SectionLabel, { id: "latest", children: site.strings.latest }), _jsx("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3", children: posts.map((post) => (_jsx(PostCard, { site: site, post: post }, post.slug))) })] }));
56
+ }
57
+ /** A plain list: date, title and summary per row, no covers, featured posts first. */
58
+ function PostList({ site, posts }) {
59
+ return (_jsxs("section", { "aria-labelledby": "latest", className: "mb-16", children: [_jsx(SectionLabel, { id: "latest", children: site.strings.latest }), _jsx("ul", { className: "flex flex-col", children: posts.map((post) => (_jsx("li", { children: _jsx(PostRow, { site: site, post: post }) }, post.slug))) })] }));
60
+ }
61
+ /** Shows the label of every section, so a category page never jumps from its h1 to the cards' h3s. */
62
+ export function BlogIndexView(props) {
63
+ const { site, heading, subtitle, categories, activeCategory, featured, posts } = props;
64
+ const featuredSlugs = new Set(featured.map((post) => post.slug));
65
+ const rest = posts.filter((post) => !featuredSlugs.has(post.slug));
66
+ const listed = [...featured, ...rest];
67
+ const layout = site.indexLayout;
68
+ return (_jsxs("div", { className: "site-blog-index site-page-top pb-20 md:pb-28", children: [_jsx(JsonLd, { json: indexJsonLd(props, listed) }), _jsxs("div", { className: "site-container", children: [_jsx("h1", { className: "mb-2 text-3xl font-bold", style: { color: "var(--site-fg)", fontFamily: "var(--font-sans)" }, children: heading }), _jsx("p", { className: "mb-8 text-sm", style: { color: "var(--site-fg-muted)", fontFamily: "var(--font-mono)" }, children: subtitle }), _jsx(CategoryTabs, { site: site, categories: categories, active: activeCategory }), listed.length === 0 ? _jsx("p", { style: { color: "var(--site-fg-muted)" }, children: site.strings.noPosts }) : null, layout === "magazine" ? _jsx(Magazine, { site: site, featured: featured, rest: rest }) : null, layout === "grid" && listed.length > 0 ? _jsx(LatestGrid, { site: site, posts: listed }) : null, layout === "list" && listed.length > 0 ? _jsx(PostList, { site: site, posts: listed }) : null] })] }));
69
+ }
70
+ //# sourceMappingURL=index-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-view.js","sourceRoot":"","sources":["../../src/blog/index-view.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAoB,MAAM,gBAAgB,CAAC;AAGnF,SAAS,aAAa,CAAC,EAAE,IAAI,EAAE,KAAK,EAA2E;IAC9G,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;IAC7C,OAAO,CACN,eAAK,SAAS,EAAC,qBAAqB,aAClC,IAAI,CAAC,CAAC,CAAC,KAAC,YAAY,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAI,CAAC,CAAC,CAAC,IAAI,EACtD,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAClB,cAAK,SAAS,EAAC,uCAAuC,YACpD,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC1B,KAAC,QAAQ,IAAiB,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,SAAS,EAAC,QAAQ,EAAE,CAAC,IAAI,IAAI,KAAK,KAAK,CAAC,IAAhF,IAAI,CAAC,IAAI,CAA2E,CACnG,CAAC,GACG,CACN,CAA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,EAAE,EAAE,KAAK,EAAE,sBAAsB,EAAE,UAAU,EAAE,kBAAkB,EAAE,YAClG,QAAQ,GACN,EACJ,KAAC,YAAY,IAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,GAAI,EAC3E,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,YAAG,KAAK,EAAE,EAAE,KAAK,EAAE,sBAAsB,EAAE,YAAG,IAAI,CAAC,OAAO,CAAC,OAAO,GAAK,CAAC,CAAC,CAAC,IAAI,EACpG,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,KAAC,QAAQ,IAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,GAAI,CAAC,CAAC,CAAC,IAAI,EACvF,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAC,UAAU,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,GAAI,CAAC,CAAC,CAAC,IAAI,EACzF,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAC,QAAQ,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,GAAI,CAAC,CAAC,CAAC,IAAI,IACnF,IACD,CACN,CAAC;AACH,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { type ReactNode } from "react";
2
+ /**
3
+ * Renders the inline markdown subset a post's title and description may use. Pair it with
4
+ * stripInlineMarkdown anywhere the same string has to be plain text (document title, meta
5
+ * description, Open Graph, JSON-LD, alt text).
6
+ *
7
+ * strong stays the element even though it is not rendered bold: it marks importance for
8
+ * assistive technology. Styles are inline because a docs stylesheet that loads later can
9
+ * redeclare common selectors at equal specificity, and inline styles cannot lose that fight.
10
+ */
11
+ export declare function InlineMarkdown({ text, inHeading }: {
12
+ text: string;
13
+ inHeading?: boolean;
14
+ }): ReactNode;
15
+ //# sourceMappingURL=inline-markdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline-markdown.d.ts","sourceRoot":"","sources":["../../src/blog/inline-markdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAoBjD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,SAAiB,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CA2B5G"}
@@ -0,0 +1,44 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Fragment } from "react";
3
+ import { tokenizeInlineMarkdown } from "../markdown/inline.js";
4
+ /**
5
+ * Emphasis is carried by colour alone, never weight. In a heading it takes the brand's text
6
+ * accent: a title already renders at the heaviest weight the family loads, so weight has no room
7
+ * left to say anything there. In a description it takes half a step of brightness: a standfirst
8
+ * sits at the muted foreground, and lifting a phrase all the way to the full foreground reads as
9
+ * a different colour rather than an emphasised one.
10
+ */
11
+ const HEADING_EMPHASIS = "var(--site-brand-text)";
12
+ const BODY_EMPHASIS = "color-mix(in srgb, var(--site-fg-muted) 50%, var(--site-fg))";
13
+ /**
14
+ * A site stylesheet may give strong and em their own weights, which outrank inheritance, so each
15
+ * element states the weight it wants back. Without that, a colour-only emphasis still arrives
16
+ * bold, and an italic inside a heading renders thinner than the words either side of it.
17
+ */
18
+ const INHERIT_WEIGHT = { fontWeight: "inherit" };
19
+ /**
20
+ * Renders the inline markdown subset a post's title and description may use. Pair it with
21
+ * stripInlineMarkdown anywhere the same string has to be plain text (document title, meta
22
+ * description, Open Graph, JSON-LD, alt text).
23
+ *
24
+ * strong stays the element even though it is not rendered bold: it marks importance for
25
+ * assistive technology. Styles are inline because a docs stylesheet that loads later can
26
+ * redeclare common selectors at equal specificity, and inline styles cannot lose that fight.
27
+ */
28
+ export function InlineMarkdown({ text, inHeading = false }) {
29
+ return tokenizeInlineMarkdown(text).map((token, index) => {
30
+ // Keyed by position: the token list comes from one immutable string, so it never reorders.
31
+ const key = `${token.kind}-${index}`;
32
+ switch (token.kind) {
33
+ case "strong":
34
+ return (_jsx("strong", { style: { ...INHERIT_WEIGHT, color: inHeading ? HEADING_EMPHASIS : BODY_EMPHASIS }, children: token.value }, key));
35
+ case "em":
36
+ return (_jsx("em", { style: { ...INHERIT_WEIGHT, color: "inherit", fontStyle: "italic" }, children: token.value }, key));
37
+ case "code":
38
+ return (_jsx("code", { style: { color: "inherit", fontFamily: "var(--font-mono)", fontSize: "0.9em" }, children: token.value }, key));
39
+ default:
40
+ return _jsx(Fragment, { children: token.value }, key);
41
+ }
42
+ });
43
+ }
44
+ //# sourceMappingURL=inline-markdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline-markdown.js","sourceRoot":"","sources":["../../src/blog/inline-markdown.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D;;;;;;GAMG;AACH,MAAM,gBAAgB,GAAG,wBAAwB,CAAC;AAClD,MAAM,aAAa,GAAG,8DAA8D,CAAC;AAErF;;;;GAIG;AACH,MAAM,cAAc,GAAG,EAAE,UAAU,EAAE,SAAS,EAAW,CAAC;AAE1D;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,IAAI,EAAE,SAAS,GAAG,KAAK,EAAyC;IAChG,OAAO,sBAAsB,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QACxD,2FAA2F;QAC3F,MAAM,GAAG,GAAG,GAAG,KAAK,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC;QACrC,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;YACpB,KAAK,QAAQ;gBACZ,OAAO,CACN,iBAAkB,KAAK,EAAE,EAAE,GAAG,cAAc,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,aAAa,EAAE,YACjG,KAAK,CAAC,KAAK,IADA,GAAG,CAEP,CACT,CAAC;YACH,KAAK,IAAI;gBACR,OAAO,CACN,aAAc,KAAK,EAAE,EAAE,GAAG,cAAc,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,YAC/E,KAAK,CAAC,KAAK,IADJ,GAAG,CAEP,CACL,CAAC;YACH,KAAK,MAAM;gBACV,OAAO,CACN,eAAgB,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,kBAAkB,EAAE,QAAQ,EAAE,OAAO,EAAE,YAC5F,KAAK,CAAC,KAAK,IADF,GAAG,CAEP,CACP,CAAC;YACH;gBACC,OAAO,KAAC,QAAQ,cAAY,KAAK,CAAC,KAAK,IAAjB,GAAG,CAA0B,CAAC;QACtD,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,37 @@
1
+ import type { ReactElement } from "react";
2
+ import { type BlogSite } from "./site.js";
3
+ /** What a listing needs to know about a post. A site maps its own post records to this. */
4
+ export interface PostSummary {
5
+ readonly slug: string;
6
+ readonly title: string;
7
+ readonly description?: string;
8
+ readonly date: Date;
9
+ readonly category: string;
10
+ /** Site-relative cover image. A post may have none; its card then shows text only. */
11
+ readonly cover?: string;
12
+ }
13
+ /** One card size per tier of the page, each stepping the title down so the hierarchy reads first. */
14
+ export type CardSize = "hero" | "feature" | "compact";
15
+ interface CardProps {
16
+ readonly site: BlogSite;
17
+ readonly post: PostSummary;
18
+ }
19
+ /**
20
+ * A stacked card: cover on top, text below. Each card spans four rows of its grid as a subgrid,
21
+ * so the cards in one row share their cover, meta, title and description tracks and end on the
22
+ * same line.
23
+ */
24
+ export declare function PostCard({ site, post, size, priority, }: CardProps & {
25
+ readonly size?: Exclude<CardSize, "hero">;
26
+ readonly priority?: boolean;
27
+ }): ReactElement;
28
+ /**
29
+ * The featured hero: cover beside the text from lg up. An empty block holds the cover's 40:21
30
+ * shape and the image fills the column over it, so taller text crops the image instead of
31
+ * leaving a gap under it. The read link gets an underline on hover, never colour alone.
32
+ */
33
+ export declare function PostHeroCard({ site, post }: CardProps): ReactElement;
34
+ /** A row of the plain list: meta, title and summary, divided by a rule, the whole row a link. */
35
+ export declare function PostRow({ site, post }: CardProps): ReactElement;
36
+ export {};
37
+ //# sourceMappingURL=post-card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post-card.d.ts","sourceRoot":"","sources":["../../src/blog/post-card.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI1C,OAAO,EAAE,KAAK,QAAQ,EAAgB,MAAM,WAAW,CAAC;AAExD,2FAA2F;AAC3F,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,sFAAsF;IACtF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,qGAAqG;AACrG,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;AAuFtD,UAAU,SAAS;IAClB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;CAC3B;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,EACxB,IAAI,EACJ,IAAI,EACJ,IAAgB,EAChB,QAAgB,GAChB,EAAE,SAAS,GAAG;IAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,YAAY,CAwBvG;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,SAAS,GAAG,YAAY,CA0BpE;AAED,iGAAiG;AACjG,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,SAAS,GAAG,YAAY,CAU/D"}
@@ -0,0 +1,68 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import Image from "next/image";
3
+ import { formatShortDate } from "../format/dates.js";
4
+ import { Arrow } from "./arrow.js";
5
+ import { InlineMarkdown } from "./inline-markdown.js";
6
+ import { postCategory } from "./site.js";
7
+ /** Inline, because a site stylesheet may size headings outside any cascade layer; clamp() does the breakpoints. */
8
+ const TITLE_SIZE = {
9
+ hero: "clamp(24px, 1.2rem + 0.9vw, 32px)",
10
+ feature: "clamp(20px, 1rem + 0.6vw, 24px)",
11
+ compact: "20px",
12
+ };
13
+ const DESCRIPTION_CLASS = {
14
+ hero: "text-sm xl:text-base line-clamp-5",
15
+ feature: "text-sm line-clamp-3",
16
+ compact: "text-sm line-clamp-4",
17
+ };
18
+ const COVER_SIZES = {
19
+ hero: "(min-width: 1024px) 58vw, 100vw",
20
+ feature: "(min-width: 768px) 50vw, 100vw",
21
+ compact: "(min-width: 1024px) 33vw, (min-width: 768px) 50vw, 100vw",
22
+ };
23
+ // The whole card is the link; hover changes the border colour only, because cards never move.
24
+ const CARD_CLASS = "group overflow-hidden rounded-lg border transition-colors hover:border-[var(--site-brand)]";
25
+ const CARD_STYLE = { borderColor: "var(--site-border)", background: "var(--site-surface)" };
26
+ const NO_INSETS = { meta: "", title: "", description: "" };
27
+ const STACKED_INSETS = {
28
+ feature: { meta: "px-6 pt-6 md:px-8 md:pt-8", title: "px-6 md:px-8", description: "px-6 pb-6 md:px-8 md:pb-8" },
29
+ compact: { meta: "px-6 pt-6", title: "px-6", description: "px-6 pb-6" },
30
+ };
31
+ /**
32
+ * Meta, title and description as three siblings, so a stacked card can put each on its own
33
+ * subgrid row. The description renders even when empty, because the last row carries the
34
+ * card's bottom padding, and that padding sits on a wrapper since line-clamp clips at the
35
+ * padding edge.
36
+ */
37
+ function PostText({ site, post, size, insets = NO_INSETS }) {
38
+ const category = postCategory(site, post.category);
39
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: `flex items-center gap-3 pb-3 text-xs ${insets.meta}`, style: { color: "var(--site-fg-muted)", fontFamily: "var(--font-mono)" }, children: [_jsx("time", { dateTime: post.date.toISOString(), children: formatShortDate(post.date, site.locale) }), category ? (_jsxs(_Fragment, { children: [_jsx("span", { style: { color: "var(--site-border)" }, children: "|" }), _jsx("span", { children: category.name })] })) : null] }), _jsx("h3", { className: `transition-colors group-hover:text-[var(--site-brand)] ${insets.title}`, style: {
40
+ color: "var(--site-fg)",
41
+ fontFamily: "var(--font-sans)",
42
+ fontSize: TITLE_SIZE[size],
43
+ lineHeight: 1.25,
44
+ }, children: _jsx(InlineMarkdown, { text: post.title, inHeading: true }) }), _jsx("div", { className: `pt-3 ${insets.description}`, children: _jsx("p", { className: `leading-relaxed ${DESCRIPTION_CLASS[size]}`, style: { color: "var(--site-fg-muted)" }, children: post.description ? _jsx(InlineMarkdown, { text: post.description }) : null }) })] }));
45
+ }
46
+ /**
47
+ * A stacked card: cover on top, text below. Each card spans four rows of its grid as a subgrid,
48
+ * so the cards in one row share their cover, meta, title and description tracks and end on the
49
+ * same line.
50
+ */
51
+ export function PostCard({ site, post, size = "compact", priority = false, }) {
52
+ return (_jsxs("a", { href: site.postPath(post.slug), className: `${CARD_CLASS} row-span-4 grid grid-rows-subgrid gap-y-0`, style: CARD_STYLE, children: [post.cover ? (_jsx(Image, { src: post.cover, alt: "", width: 1200, height: 630, className: "aspect-[40/21] w-full object-cover", sizes: COVER_SIZES[size], priority: priority })) : (
53
+ // Holds the cover row of the subgrid, so a card without one still lines up with its row.
54
+ _jsx("div", {})), _jsx(PostText, { site: site, post: post, size: size, insets: STACKED_INSETS[size] })] }));
55
+ }
56
+ /**
57
+ * The featured hero: cover beside the text from lg up. An empty block holds the cover's 40:21
58
+ * shape and the image fills the column over it, so taller text crops the image instead of
59
+ * leaving a gap under it. The read link gets an underline on hover, never colour alone.
60
+ */
61
+ export function PostHeroCard({ site, post }) {
62
+ return (_jsxs("a", { href: site.postPath(post.slug), className: `${CARD_CLASS} flex flex-col lg:grid lg:grid-cols-12`, style: CARD_STYLE, children: [post.cover ? (_jsxs("div", { className: "relative lg:col-span-7", children: [_jsx("div", { className: "aspect-[40/21]" }), _jsx(Image, { src: post.cover, alt: "", fill: true, className: "object-cover", sizes: COVER_SIZES.hero, priority: true })] })) : null, _jsxs("div", { className: `flex flex-col justify-center p-6 md:p-8 ${post.cover ? "lg:col-span-5" : "lg:col-span-12"} lg:p-10`, children: [_jsx(PostText, { site: site, post: post, size: "hero" }), _jsxs("span", { className: "mt-6 inline-flex w-fit items-center gap-2 text-sm font-semibold text-[var(--site-cta)] decoration-1 underline-offset-[3px] transition-colors group-hover:text-[var(--site-link)] group-hover:underline", style: { fontFamily: "var(--font-sans)" }, children: [site.strings.readThePost, " ", _jsx(Arrow, {})] })] })] }));
63
+ }
64
+ /** A row of the plain list: meta, title and summary, divided by a rule, the whole row a link. */
65
+ export function PostRow({ site, post }) {
66
+ return (_jsx("a", { href: site.postPath(post.slug), className: "group block border-b py-6", style: { borderColor: "var(--site-border)" }, children: _jsx(PostText, { site: site, post: post, size: "compact" }) }));
67
+ }
68
+ //# sourceMappingURL=post-card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post-card.js","sourceRoot":"","sources":["../../src/blog/post-card.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,YAAY,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,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G,KAAC,QAAQ,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,MAAM,GAAG,EAChD,gBACC,SAAS,EAAC,wMAAwM,EAClN,KAAK,EAAE,EAAE,UAAU,EAAE,kBAAkB,EAAE,aAExC,IAAI,CAAC,OAAO,CAAC,WAAW,OAAE,KAAC,KAAK,KAAG,IAC9B,IACF,IACH,CACJ,CAAC;AACH,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,EAAa;IAChD,OAAO,CACN,YACC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAC9B,SAAS,EAAC,2BAA2B,EACrC,KAAK,EAAE,EAAE,WAAW,EAAE,oBAAoB,EAAE,YAE5C,KAAC,QAAQ,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,SAAS,GAAG,GAChD,CACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,57 @@
1
+ import type { SiteIdentity } from "../config/identity.js";
2
+ import type { SiteConfig } from "../config/site-config.js";
3
+ import { type SiteStrings } from "../i18n/strings.js";
4
+ import { type UrlStyle } from "../site/url-style.js";
5
+ /** A named link at a site-relative path: a breadcrumb, a category, a section. */
6
+ export type NamedPath = {
7
+ readonly name: string;
8
+ readonly path: string;
9
+ };
10
+ /**
11
+ * Everything the blog views need to know about the site, resolved once from the site config and
12
+ * the site identity, so no view reads a brand fact or a path from anywhere else.
13
+ */
14
+ export type BlogSite = {
15
+ readonly origin: string;
16
+ readonly publisher: string;
17
+ /** The identity's one-line description, for feeds and the site's own metadata. */
18
+ readonly description: string;
19
+ readonly locale: string;
20
+ /** The brand's X handle for `twitter:site`, from the identity's `x` link; unset when the brand has none. */
21
+ readonly xSite?: string;
22
+ readonly strings: SiteStrings;
23
+ readonly titleSeparator: string;
24
+ /** The layout's document title template, for example "%s ~ Acme". */
25
+ readonly titleTemplate: string;
26
+ readonly blogPath: string;
27
+ readonly indexLayout: "list" | "grid" | "magazine";
28
+ readonly categories: ReadonlyArray<NamedPath & {
29
+ readonly slug: string;
30
+ }>;
31
+ /** A page path in the site's URL style: with the trailing slash a static export serves, or without. */
32
+ page(path: string): string;
33
+ /** Where a page's Markdown copy lives: `/md/<path>.md` on a slashed site, `<page>/md` on the other. */
34
+ markdownPath(pagePath: string): string;
35
+ postPath(slug: string): string;
36
+ categoryPath(slug: string): string;
37
+ category(slug: string): NamedPath | undefined;
38
+ authorPath(name: string): string;
39
+ /** The author's X handle for `twitter:creator`, or null when the site config gives them none. */
40
+ authorX(name: string): string | null;
41
+ };
42
+ /** A post byline with no matching author in the site config. */
43
+ export declare class BlogAuthorError extends Error {
44
+ constructor(name: string);
45
+ }
46
+ /** A post whose category slug is not in the site config. */
47
+ export declare class BlogCategoryError extends Error {
48
+ constructor(slug: string);
49
+ }
50
+ /** The category a post names, which must exist; a post with no category has none. */
51
+ export declare function postCategory(site: BlogSite, slug: string | undefined): NamedPath | undefined;
52
+ /** A blog view asked for on a site whose config turns the blog off. */
53
+ export declare class BlogSectionError extends Error {
54
+ constructor();
55
+ }
56
+ export declare function blogSite(config: SiteConfig, identity: SiteIdentity, style: UrlStyle): BlogSite;
57
+ //# sourceMappingURL=site.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../../src/blog/site.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,KAAK,WAAW,EAAc,MAAM,oBAAoB,CAAC;AAElE,OAAO,EAAE,KAAK,QAAQ,EAAY,MAAM,sBAAsB,CAAC;AAE/D,iFAAiF;AACjF,MAAM,MAAM,SAAS,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IA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