sproutsite 0.0.0-stage → 0.5.8

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 (116) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +14 -0
  3. package/README.md +604 -2
  4. package/THIRD_PARTY_NOTICES.md +85 -0
  5. package/VERSION +1 -0
  6. package/package.json +107 -5
  7. package/src/lib/sproutsite/colors.ts +7 -0
  8. package/src/lib/sproutsite/language-links.ts +60 -0
  9. package/src/lib/sproutsite/pages.ts +78 -0
  10. package/src/lib/sproutsite/rehype-ids.ts +20 -0
  11. package/src/lib/sproutsite/rehype-links.ts +19 -0
  12. package/src/lib/sproutsite/rehype-tables.ts +74 -0
  13. package/src/lib/sproutsite/remark-links.ts +19 -0
  14. package/src/lib/sproutsite/site-config.ts +110 -0
  15. package/src/lib/sproutsite/sitemap.ts +160 -0
  16. package/src/lib/sproutsite/types.ts +45 -0
  17. package/src/lib/sproutsite/urls.ts +79 -0
  18. package/src/lib/sproutsite/validation.ts +1406 -0
  19. package/src/package/404.astro +5 -0
  20. package/src/package/500.astro +5 -0
  21. package/src/package/components.ts +17 -0
  22. package/src/package/config.ts +161 -0
  23. package/src/package/content.ts +117 -0
  24. package/src/package/index.ts +3 -0
  25. package/src/package/manifest.ts +27 -0
  26. package/src/package/page.astro +124 -0
  27. package/src/themes/default/assets/branding/apple-touch-icon.png +0 -0
  28. package/src/themes/default/assets/branding/favicon-16x16.png +0 -0
  29. package/src/themes/default/assets/branding/favicon-32x32.png +0 -0
  30. package/src/themes/default/assets/branding/favicon-48x48.png +0 -0
  31. package/src/themes/default/assets/branding/favicon.ico +0 -0
  32. package/src/themes/default/assets/branding/favicon.svg +1 -0
  33. package/src/themes/default/assets/branding/icon-192x192.png +0 -0
  34. package/src/themes/default/assets/branding/icon-512x512.png +0 -0
  35. package/src/themes/default/assets/branding/icon-monochrome.svg +1 -0
  36. package/src/themes/default/assets/branding/icon.svg +18 -0
  37. package/src/themes/default/assets/branding/logo-dark.svg +18 -0
  38. package/src/themes/default/assets/branding/logo-monochrome.svg +1 -0
  39. package/src/themes/default/assets/branding/logo.svg +18 -0
  40. package/src/themes/default/assets/branding/social-card.png +0 -0
  41. package/src/themes/default/assets/hero-waves.svg +41 -0
  42. package/src/themes/default/components/atoms/Badge/Badge.astro +65 -0
  43. package/src/themes/default/components/atoms/Badge/Badge.css +5 -0
  44. package/src/themes/default/components/atoms/BrandLogo/BrandLogo.astro +26 -0
  45. package/src/themes/default/components/atoms/BrandLogo/BrandLogo.css +22 -0
  46. package/src/themes/default/components/atoms/Button/Button.astro +106 -0
  47. package/src/themes/default/components/atoms/Button/Button.css +14 -0
  48. package/src/themes/default/components/atoms/ContentImage/ContentImage.astro +54 -0
  49. package/src/themes/default/components/atoms/ContentImage/ContentImage.css +21 -0
  50. package/src/themes/default/components/atoms/Eyebrow/Eyebrow.astro +3 -0
  51. package/src/themes/default/components/atoms/Eyebrow/Eyebrow.css +18 -0
  52. package/src/themes/default/components/atoms/Icon/Icon.astro +80 -0
  53. package/src/themes/default/components/atoms/Icon/Icon.css +68 -0
  54. package/src/themes/default/components/atoms/Tab/Tab.astro +15 -0
  55. package/src/themes/default/components/atoms/Tab/Tab.css +34 -0
  56. package/src/themes/default/components/layout/Column/Column.astro +18 -0
  57. package/src/themes/default/components/layout/Column/Column.css +82 -0
  58. package/src/themes/default/components/layout/Columns/Columns.astro +163 -0
  59. package/src/themes/default/components/layout/Columns/Columns.css +177 -0
  60. package/src/themes/default/components/molecules/Accordion/Accordion.astro +17 -0
  61. package/src/themes/default/components/molecules/Accordion/Accordion.css +11 -0
  62. package/src/themes/default/components/molecules/Accordion/accordion.ts +47 -0
  63. package/src/themes/default/components/molecules/AccordionItem/AccordionItem.astro +100 -0
  64. package/src/themes/default/components/molecules/AccordionItem/AccordionItem.css +118 -0
  65. package/src/themes/default/components/molecules/Alert/Alert.astro +42 -0
  66. package/src/themes/default/components/molecules/Alert/Alert.css +13 -0
  67. package/src/themes/default/components/molecules/Card/Card.astro +57 -0
  68. package/src/themes/default/components/molecules/Card/Card.css +25 -0
  69. package/src/themes/default/components/molecules/CardActions/CardActions.astro +3 -0
  70. package/src/themes/default/components/molecules/CardActions/CardActions.css +13 -0
  71. package/src/themes/default/components/molecules/ContentTable/ContentTable.astro +42 -0
  72. package/src/themes/default/components/molecules/ContentTable/ContentTable.css +59 -0
  73. package/src/themes/default/components/molecules/Feature/Feature.astro +108 -0
  74. package/src/themes/default/components/molecules/Feature/Feature.css +157 -0
  75. package/src/themes/default/components/molecules/FoundationSample/FoundationSample.astro +165 -0
  76. package/src/themes/default/components/molecules/FoundationSample/FoundationSample.css +201 -0
  77. package/src/themes/default/components/molecules/LanguageSwitcher/LanguageSwitcher.astro +118 -0
  78. package/src/themes/default/components/molecules/LanguageSwitcher/LanguageSwitcher.css +134 -0
  79. package/src/themes/default/components/molecules/Tabs/Tabs.astro +33 -0
  80. package/src/themes/default/components/molecules/Tabs/Tabs.css +38 -0
  81. package/src/themes/default/components/molecules/Tabs/tabs.ts +91 -0
  82. package/src/themes/default/components/organisms/BlogIndex/BlogIndex.astro +86 -0
  83. package/src/themes/default/components/organisms/BlogIndex/BlogIndex.css +17 -0
  84. package/src/themes/default/components/organisms/BlogPost/BlogPost.astro +51 -0
  85. package/src/themes/default/components/organisms/BlogPost/BlogPost.css +5 -0
  86. package/src/themes/default/components/organisms/Footer/Footer.astro +57 -0
  87. package/src/themes/default/components/organisms/Footer/Footer.css +63 -0
  88. package/src/themes/default/components/organisms/Header/Header.astro +223 -0
  89. package/src/themes/default/components/organisms/Header/Header.css +282 -0
  90. package/src/themes/default/components/organisms/Hero/Hero.astro +106 -0
  91. package/src/themes/default/components/organisms/Hero/Hero.css +187 -0
  92. package/src/themes/default/components/organisms/PageTitle/PageTitle.astro +39 -0
  93. package/src/themes/default/components/organisms/PageTitle/PageTitle.css +25 -0
  94. package/src/themes/default/components/organisms/Section/Section.astro +39 -0
  95. package/src/themes/default/components/organisms/Section/Section.css +21 -0
  96. package/src/themes/default/i18n/de.yaml +38 -0
  97. package/src/themes/default/i18n/en.yaml +38 -0
  98. package/src/themes/default/i18n/index.ts +63 -0
  99. package/src/themes/default/layouts/ErrorPage/ErrorPage.astro +110 -0
  100. package/src/themes/default/layouts/PageLayout/PageLayout.astro +108 -0
  101. package/src/themes/default/layouts/PageLayout/PageLayout.css +15 -0
  102. package/src/themes/default/styles/foundation/base.css +19 -0
  103. package/src/themes/default/styles/foundation/focus.css +6 -0
  104. package/src/themes/default/styles/foundation/fonts/OFL.txt +93 -0
  105. package/src/themes/default/styles/foundation/fonts/nunito-latin-variable.woff2 +0 -0
  106. package/src/themes/default/styles/foundation/fonts.css +17 -0
  107. package/src/themes/default/styles/foundation/layout.css +6 -0
  108. package/src/themes/default/styles/foundation/prose.css +54 -0
  109. package/src/themes/default/styles/foundation/tokens.css +48 -0
  110. package/src/themes/default/styles/theme.css +99 -0
  111. package/src/themes/default/styles/themes/section-tones.css +30 -0
  112. package/third-party-licenses/daisyui-LICENSE +21 -0
  113. package/third-party-licenses/flag-icons-LICENSE +21 -0
  114. package/third-party-licenses/lucide-LICENSE +43 -0
  115. package/third-party-licenses/tailwindcss-LICENSE +21 -0
  116. package/third-party-licenses/tailwindcss-typography-LICENSE +21 -0
@@ -0,0 +1,85 @@
1
+ # Third-party notices and asset licensing status
2
+
3
+ Review date: 2026-11-16.
4
+
5
+ The root [LICENSE](LICENSE) and [NOTICE](NOTICE) license Sproutsite's first-party source code under Apache-2.0 and identify its original author. They do not replace third-party licenses or establish rights to reference material. This file records the scope of the repository review and outstanding asset checks; it adds no conditions to Apache-2.0.
6
+
7
+ ## Local fonts
8
+
9
+ Nunito is third-party font software licensed under the SIL Open Font License 1.1, with the existing notice:
10
+
11
+ > Copyright 2014 The Nunito Project Authors (https://github.com/googlefonts/nunito)
12
+
13
+ | File | License and copyright notice | Distribution |
14
+ | ------------------------------------------------------------------------ | ---------------------------- | ----------------------------------------------------------- |
15
+ | `src/themes/default/styles/foundation/fonts/nunito-latin-variable.woff2` | Adjacent `OFL.txt` | Included in the npm package |
16
+ | `scripts/assets/nunito-variable.ttf` | Adjacent `OFL.txt` | Repository development asset; excluded from the npm package |
17
+
18
+ Both existing `OFL.txt` files are retained unchanged. The source font is from the [official Nunito distribution](https://github.com/google/fonts/tree/main/ofl/nunito). Apache-2.0 does not replace the OFL. The project's artwork license below does not relicense Nunito or remove its applicable notices.
19
+
20
+ ## Dependency licenses and notices
21
+
22
+ Language-selector flags are local SVG assets from `flag-icons` 7.6.0, licensed under MIT. The full, unmodified [upstream license](third-party-licenses/flag-icons-LICENSE), including Panayiotis Lipiridis's copyright notice, is retained for redistribution. Only the GB and DE SVGs used by the theme are bundled into the website; no flag CDN or external requests are required. Preserve the upstream notice when redistributing these assets.
23
+
24
+ Lucide icons are rendered from `@lucide/astro` 1.73.0. Its full, unmodified [license text](third-party-licenses/lucide-LICENSE) is included with the npm package: ISC for Lucide, plus the upstream MIT notice and icon list for Feather-derived artwork. These icons retain their upstream licensing independently of the project-branding artwork below. Preserve the applicable notices when distributing rendered SVGs or a generated website containing them.
25
+
26
+ Dependencies remain separately licensed packages. This review inspected the root manifest, locked license metadata, and the license/NOTICE files present in the installed dependencies. It is not a certification of every transitive component or a grant of rights to their code.
27
+
28
+ The npm archive contains Sproutsite sources and assets, not `node_modules` or bundled dependency executables. Dependencies are installed separately with their own notices. A generated website or separately distributed build/tool bundle must retain the applicable upstream notices for the code and fonts it actually includes.
29
+
30
+ The default theme uses the following MIT-licensed CSS packages. Unmodified copies of their installed license texts are included for redistribution reference:
31
+
32
+ | Package | Reviewed version | Retained license text |
33
+ | ----------------------- | ---------------- | ------------------------------------------------------------------------------------- |
34
+ | DaisyUI | 5.7.42 | [daisyui-LICENSE](third-party-licenses/daisyui-LICENSE) |
35
+ | Tailwind CSS | 4.3.3 | [tailwindcss-LICENSE](third-party-licenses/tailwindcss-LICENSE) |
36
+ | Tailwind CSS Typography | 0.5.20 | [tailwindcss-typography-LICENSE](third-party-licenses/tailwindcss-typography-LICENSE) |
37
+
38
+ Other direct runtime and peer dependencies declare MIT (`astro`, `@astrojs/mdx`, `@astrojs/markdown-remark`, `@astrojs/sitemap`, `@shikijs/langs`, `@tailwindcss/vite`, `remark-gfm`, `remark-mdx`, `remark-parse`, `unified`, `unist-util-visit`, and `zod`) or ISC (`github-slugger` and `yaml`). Their installed upstream licenses are not changed by the project's Apache-2.0 declaration. Review the actual distributed dependency versions again when preparing a release or bundling their code.
39
+
40
+ The installed dependency tree also contains components requiring distinct treatment:
41
+
42
+ - `lightningcss` and its platform packages declare MPL-2.0 and are used by the CSS build tooling. Their source is not relicensed under Apache-2.0.
43
+ - `axe-core` and `@axe-core/playwright` declare MPL-2.0 and are development/test tools. `axe-core/LICENSE-3RD-PARTY.txt` is retained in the installed package.
44
+ - Sharp declares Apache-2.0; its optional libvips/platform components include LGPL-3.0-or-later and combined license expressions. They are not included in Sproutsite's npm archive. Redistributing native binaries or a complete toolchain requires reviewing those components' own notices and source/relinking obligations.
45
+ - `playwright`, `playwright-core`, and `@playwright/test` retain their original `NOTICE` files identifying Microsoft and code derived from Puppeteer. These development dependencies are not bundled into Sproutsite's npm archive, so their notices are not represented as Sproutsite-authored notices in the root `NOTICE`.
46
+ - TypeScript retains its installed `LICENSE.txt` and `ThirdPartyNoticeText.txt`. Some development packages, including Fontkit and Storybook packages, declare MIT in their manifests without a standalone license file at the installed package root. Their upstream notices need to accompany any separate redistribution of those tools; the tools are not part of this npm archive.
47
+
48
+ No installed dependency license or NOTICE file was removed, overwritten, or relicensed. Dependency license metadata alone does not establish that arbitrary future bundling or redistribution is compliant.
49
+
50
+ ## Project branding and hero artwork
51
+
52
+ On 2026-11-16, project maintainer Björn Hempel confirmed that the supplied logo reference and hero SVG were created with AI assistance and explicitly authorized making the following project artwork available under the Apache License, Version 2.0, to the extent he holds rights that he can license. The technical derivation is recorded below. No particular AI provider, model, or absence of third-party reference inputs is asserted by this confirmation.
53
+
54
+ | Asset scope | Recorded origin and derivation | Release status |
55
+ | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------- |
56
+ | `src/themes/default/assets/branding/icon.svg` and the other branding SVGs | Reconstructed and subsequently refined as vector artwork for Sproutsite from the maintainer's AI-created logo reference. `scripts/generate-branding.ts` contains the vector geometry and generation process. | Apache-2.0 under the maintainer's authorization stated above. |
57
+ | Favicons, app icons, and `social-card.png` in the same branding directory | Generated from the project's vector artwork by `npm run branding:generate`. | Apache-2.0 under the same authorization, including these derived files. |
58
+ | `src/themes/default/assets/hero-waves.svg` | The maintainer supplied the AI-created `sproutsite-hero-waves.svg` for integration. The project subsequently adjusted its composition, gradients, and positioning. | Apache-2.0 under the maintainer's authorization stated above. |
59
+
60
+ All three scopes are included in the npm archive and are covered by the root [LICENSE](LICENSE), with the project's attribution information in [NOTICE](NOTICE). Their use, modification, and redistribution follow Apache-2.0, including its applicable notice requirements. This records the maintainer's provenance statement and license grant; it does not assert exclusive copyright in AI output or independently certify third-party rights. Nunito and all other third-party materials retain their own licenses and applicable notices.
61
+
62
+ Copyright licensing of artwork and trademark rights are separate. Apache-2.0 Section 6 does not grant general trademark rights; this file adds no trademark restrictions or extra attribution obligations.
63
+
64
+ ## Other visual assets: provenance review remains open
65
+
66
+ Generation record: `src/content/pages/showcase/_assets/accordions.png` was generated for this project on 2026-11-16 with OpenAI's image-generation tool. A text-only prompt requested an original blue-and-white 3D accordion illustration with one expanded answer, two collapsed rows, and plus/chevron indicators. No external artwork or logos were supplied as input. This records provenance, not a separate artwork-license grant.
67
+
68
+ Generation record: `src/content/pages/documentation/_assets/deployment.png` was generated for this project on 2026-11-15 with OpenAI's image-generation tool. A text-only prompt requested an original blue-and-white 3D deployment illustration with a server stack, terminal, upload arrow, and browser window. No external artwork or server-product logos were supplied. This records provenance, not a separate artwork-license grant.
69
+
70
+ Generation record: `src/content/pages/showcase/_assets/features.png` was generated for this project on 2026-11-15 with OpenAI's image-generation tool. A text-only prompt requested an original blue-and-white 3D illustration of icon-and-description feature rows in the showcase's existing visual style. No external artwork, logo, or Lucide SVG was supplied as input. This records provenance, not a separate artwork-license grant.
71
+
72
+ Generation record: `src/content/blog/_assets/apache-2-license.png` was generated for this project on 2026-11-15 with OpenAI's image-generation tool. A text-only prompt requested an original blue 3D licensing illustration, with no input images, Apache feather, or foundation logos. This records provenance, not a separate artwork-license grant.
73
+
74
+ Generation record: `src/content/pages/showcase/_assets/icons.png` was generated for this project on 2026-11-15 with OpenAI's image-generation tool. The prompt described the existing showcase's blue-and-white 3D illustration style and six generic icon motifs. No external images or Lucide SVG files were supplied to the generator. This records provenance, not a separate asset-license grant.
75
+
76
+ The following existing assets do not have a committed, asset-specific rights/provenance record sufficient to declare them newly licensed under Apache-2.0. **This change does not relicense them.** Confirm their origin and redistribution permissions before publishing a package or website that includes them.
77
+
78
+ | Scope | Repository evidence | Outstanding check |
79
+ | --------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
80
+ | PNGs in `src/content/pages/_assets/`, `src/content/pages/showcase/_assets/`, and `src/content/pages/documentation/_assets/` | Committed demo illustrations without an accompanying asset licensing record. | Record the source or generation provenance, relevant terms, and any third-party reference permissions for each illustration. |
81
+ | PNGs in `src/content/blog/_assets/` | Committed article illustrations; `sproutsite-brand.png` incorporates the project branding artwork. | Record provenance and license for each complete illustration; the branding authorization above covers the underlying branding, not automatically every composite image. |
82
+
83
+ The branding and hero SVG are included by the current npm file list and their Apache-2.0 authorization is recorded separately above. This authorization does not automatically license all demo illustrations or separate composite artwork incorporating the branding. Demo content images are excluded from the npm archive but remain relevant when publishing the repository's demo website. Removing the package's private flag or passing a packaging check does not itself establish asset rights.
84
+
85
+ No additional trademark policy, registration claim, or attribution obligation is introduced here. Apache-2.0 Section 6 governs its trademark-license scope; any later artwork licensing decision should be documented explicitly rather than inferred from the software license.
package/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.5.8
package/package.json CHANGED
@@ -1,6 +1,108 @@
1
1
  {
2
- "name": "sproutsite",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
2
+ "name": "sproutsite",
3
+ "version": "0.5.8",
4
+ "license": "Apache-2.0",
5
+ "author": "Björn Hempel",
6
+ "description": "Agent-ready, Markdown-first Static CMS powered by Astro and TypeScript.",
7
+ "homepage": "https://sproutsite.dev",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/sproutsite/sproutsite.git"
11
+ },
12
+ "type": "module",
13
+ "publishConfig": {
14
+ "access": "public",
15
+ "registry": "https://registry.npmjs.org/"
16
+ },
17
+ "files": [
18
+ "src/lib/sproutsite/",
19
+ "src/package/",
20
+ "src/themes/default/",
21
+ "README.md",
22
+ "VERSION",
23
+ "LICENSE",
24
+ "NOTICE",
25
+ "THIRD_PARTY_NOTICES.md",
26
+ "third-party-licenses/"
27
+ ],
28
+ "exports": {
29
+ ".": "./src/package/index.ts",
30
+ "./content": "./src/package/content.ts",
31
+ "./config": "./src/package/config.ts",
32
+ "./components": "./src/package/components.ts",
33
+ "./page": "./src/package/page.astro",
34
+ "./package.json": "./package.json"
35
+ },
36
+ "engines": {
37
+ "node": ">=24.0.0"
38
+ },
39
+ "overrides": {
40
+ "postcss-selector-parser": "6.1.5"
41
+ },
42
+ "scripts": {
43
+ "branding:generate": "node --import tsx scripts/generate-branding.ts",
44
+ "dev": "astro dev --force",
45
+ "build": "npm run validate && astro build && node --import tsx scripts/verify-build.ts",
46
+ "build:demo": "SPROUTSITE_BASE=/demo/ npm run build",
47
+ "preview": "astro preview",
48
+ "check": "npm run validate && astro check",
49
+ "validate": "node --import tsx scripts/validate-content.ts",
50
+ "test": "node --import tsx --test tests/**/*.test.ts",
51
+ "test:a11y": "npm run build && node --import tsx scripts/test-a11y.ts",
52
+ "test:source": "node --import tsx scripts/check-source-files.ts",
53
+ "format": "prettier --write .",
54
+ "format:check": "prettier --check .",
55
+ "pack:check": "npm pack --dry-run",
56
+ "test:package": "node --import tsx scripts/test-package.ts",
57
+ "prepublishOnly": "npm run format:check && npm run test:source && npm run check && npm test && npm run build && npm run test:package",
58
+ "storybook": "storybook dev --port 6006",
59
+ "build:storybook": "storybook build"
60
+ },
61
+ "peerDependencies": {
62
+ "@astrojs/mdx": "^8.1.2",
63
+ "astro": "^7.4.4"
64
+ },
65
+ "dependencies": {
66
+ "@astrojs/markdown-remark": "^7.3.1",
67
+ "@astrojs/sitemap": "^3.7.4",
68
+ "@lucide/astro": "^1.73.0",
69
+ "@shikijs/langs": "^4.5.0",
70
+ "@tailwindcss/typography": "^0.5.20",
71
+ "@tailwindcss/vite": "^4.3.3",
72
+ "daisyui": "^5.7.42",
73
+ "flag-icons": "^7.6.0",
74
+ "github-slugger": "^2.0.0",
75
+ "remark-gfm": "^4.0.1",
76
+ "remark-mdx": "^3.1.1",
77
+ "remark-parse": "^11.0.0",
78
+ "tailwindcss": "^4.3.3",
79
+ "unified": "^11.0.5",
80
+ "unist-util-visit": "^5.1.0",
81
+ "yaml": "^2.9.1",
82
+ "zod": "^4.3.6"
83
+ },
84
+ "devDependencies": {
85
+ "@astrojs/check": "^0.9.10",
86
+ "@astrojs/mdx": "^8.1.2",
87
+ "@axe-core/playwright": "^4.13.0",
88
+ "@playwright/test": "^1.63.0",
89
+ "@storybook-astro/framework": "^1.15.0",
90
+ "@storybook/addon-docs": "^10.6.6",
91
+ "@storybook/builder-vite": "^10.6.6",
92
+ "@types/fontkit": "^2.0.9",
93
+ "astro": "^7.4.4",
94
+ "axe-core": "^4.13.0",
95
+ "fontkit": "^2.0.4",
96
+ "playwright": "^1.63.0",
97
+ "prettier": "^3.9.10",
98
+ "prettier-plugin-astro": "^1.1.2",
99
+ "sharp": "^0.35.5",
100
+ "storybook": "^10.6.6",
101
+ "tsx": "^4.23.15",
102
+ "typescript": "^6.0.3",
103
+ "vitest": "^5.0.1"
104
+ },
105
+ "allowScripts": {
106
+ "esbuild@0.28.2": true
107
+ }
108
+ }
@@ -0,0 +1,7 @@
1
+ /** CSS hexadecimal colors, including the optional alpha channel. */
2
+ export function isHexColor(value: unknown): value is `#${string}` {
3
+ return (
4
+ typeof value === 'string' &&
5
+ /^#(?:[\da-f]{3}|[\da-f]{4}|[\da-f]{6}|[\da-f]{8})$/i.test(value)
6
+ );
7
+ }
@@ -0,0 +1,60 @@
1
+ import { assemblePages } from './pages.js';
2
+ import { blogRouteFromId } from './urls.js';
3
+
4
+ export function localeOf(id: string): 'en' | 'de' {
5
+ return id.endsWith('.de') ? 'de' : 'en';
6
+ }
7
+
8
+ export function logicalId(id: string): string {
9
+ return id.replace(/\.de$/, '');
10
+ }
11
+
12
+ interface PageEntry {
13
+ id: string;
14
+ data: object;
15
+ }
16
+
17
+ /** Match existing translated content, not URL spelling; never invent routes. */
18
+ export function languageLinks(
19
+ pages: PageEntry[],
20
+ posts: { id: string }[],
21
+ locales: readonly string[],
22
+ currentLocale: string,
23
+ currentRoute: string,
24
+ ) {
25
+ const routes = locales.flatMap((locale) => {
26
+ const localizedPages = assemblePages(
27
+ pages.filter((page) => localeOf(page.id) === locale),
28
+ [],
29
+ undefined,
30
+ (entry) => logicalId(entry.id),
31
+ ).map((page) => ({
32
+ key: `page:${logicalId(page.entry.id)}`,
33
+ locale,
34
+ route: page.route,
35
+ }));
36
+ const localizedPosts = posts
37
+ .filter((post) => localeOf(post.id) === locale)
38
+ .map((post) => ({
39
+ key: `post:${logicalId(post.id)}`,
40
+ locale,
41
+ route: blogRouteFromId(logicalId(post.id)),
42
+ }));
43
+ return [
44
+ ...localizedPages,
45
+ ...localizedPosts,
46
+ { key: 'blog-index', locale, route: '/blog/' },
47
+ ];
48
+ });
49
+ const current = routes.find(
50
+ (page) => page.locale === currentLocale && page.route === currentRoute,
51
+ );
52
+ return locales.map((locale) => ({
53
+ locale,
54
+ route:
55
+ routes.find(
56
+ (page) => page.locale === locale && page.key === current?.key,
57
+ )?.route ?? '/',
58
+ current: locale === currentLocale,
59
+ }));
60
+ }
@@ -0,0 +1,78 @@
1
+ import type { CollectionEntry } from 'astro:content';
2
+ import { pageDirectoryFromId, routeFromPageId } from './urls.js';
3
+ import type { SectionTone, Tone } from './types.js';
4
+
5
+ type PageEntry = CollectionEntry<'pages'>;
6
+ type DocumentEntry = CollectionEntry<'documents'>;
7
+ type PageEntryLike = { id: string; data: object };
8
+ type DocumentEntryLike = { id: string; data: { tone: SectionTone } };
9
+
10
+ export interface AssembledPage<
11
+ TPage extends PageEntryLike = PageEntry,
12
+ TDocument extends DocumentEntryLike = DocumentEntry,
13
+ > {
14
+ entry: TPage;
15
+ route: string;
16
+ hero?: TDocument;
17
+ sections: TDocument[];
18
+ }
19
+
20
+ const sectionName = /(?:^|\/)(\d{2,})-[a-z0-9][a-z0-9-]*$/;
21
+
22
+ export function assemblePages<
23
+ TPage extends PageEntryLike,
24
+ TDocument extends DocumentEntryLike,
25
+ >(
26
+ pageEntries: TPage[],
27
+ documentEntries: TDocument[],
28
+ routeForPage?: (entry: TPage) => string,
29
+ idForEntry: (entry: TPage | TDocument) => string = (entry) => entry.id,
30
+ ): AssembledPage<TPage, TDocument>[] {
31
+ const pageUrlByDirectory = new Map(
32
+ pageEntries.map((entry) => [
33
+ pageDirectoryFromId(idForEntry(entry)),
34
+ (entry.data as { url?: string }).url,
35
+ ]),
36
+ );
37
+ const pages = pageEntries.map((entry) => {
38
+ const directory = pageDirectoryFromId(idForEntry(entry));
39
+ const prefix = directory === '' ? '' : `${directory}/`;
40
+ const ownDocuments = documentEntries.filter(
41
+ (document) =>
42
+ idForEntry(document).startsWith(prefix) &&
43
+ !idForEntry(document).slice(prefix.length).includes('/'),
44
+ );
45
+ const hero = ownDocuments.find(
46
+ (document) => idForEntry(document) === `${prefix}hero`,
47
+ );
48
+ const sections = ownDocuments
49
+ .filter((document) => sectionName.test(idForEntry(document)))
50
+ .sort(
51
+ (left, right) =>
52
+ Number(sectionName.exec(idForEntry(left))?.[1]) -
53
+ Number(sectionName.exec(idForEntry(right))?.[1]),
54
+ );
55
+ return {
56
+ entry,
57
+ route:
58
+ routeForPage?.(entry) ??
59
+ routeFromPageId(idForEntry(entry), (path) =>
60
+ pageUrlByDirectory.get(path),
61
+ ),
62
+ hero,
63
+ sections,
64
+ };
65
+ });
66
+ return pages.sort((left, right) => left.route.localeCompare(right.route));
67
+ }
68
+
69
+ export function toneOf(document: DocumentEntryLike): Tone {
70
+ const tone = document.data.tone;
71
+ if (typeof tone === 'string') return tone;
72
+ const match = sectionName.exec(document.id.replace(/\.de$/, ''));
73
+ if (!match)
74
+ throw new Error(
75
+ `${document.id}: odd/even tones require a numbered section.`,
76
+ );
77
+ return tone[Number(match[1]) % 2 === 1 ? 'odd' : 'even'];
78
+ }
@@ -0,0 +1,20 @@
1
+ import { basename } from 'node:path';
2
+ import type { Root } from 'hast';
3
+ import { visit } from 'unist-util-visit';
4
+
5
+ /** Prefixes Astro-generated heading IDs with the content filename, avoiding collisions across composed documents. */
6
+ export function rehypeUniqueHeadingIds() {
7
+ return (tree: Root, file: { path?: string }) => {
8
+ const prefix = basename(file.path ?? 'content')
9
+ .replace(/\.(?:md|mdx)$/, '')
10
+ .replace(/[^a-zA-Z0-9-]/g, '-');
11
+ visit(tree, 'element', (node) => {
12
+ if (
13
+ !/^h[1-6]$/.test(node.tagName) ||
14
+ typeof node.properties.id !== 'string'
15
+ )
16
+ return;
17
+ node.properties.id = `${prefix}-${node.properties.id}`;
18
+ });
19
+ };
20
+ }
@@ -0,0 +1,19 @@
1
+ import type { Root } from 'hast';
2
+ import { visit } from 'unist-util-visit';
3
+ import { isExternalWebLink } from './urls.js';
4
+
5
+ /** Apply the same external-link behavior after Markdown references and autolinks resolve. */
6
+ export function rehypeExternalLinks(siteUrl: string) {
7
+ return (tree: Root) => {
8
+ visit(tree, 'element', (node) => {
9
+ if (
10
+ node.tagName !== 'a' ||
11
+ typeof node.properties.href !== 'string'
12
+ )
13
+ return;
14
+ if (!isExternalWebLink(node.properties.href, siteUrl)) return;
15
+ node.properties.target = '_blank';
16
+ node.properties.rel = ['noopener', 'noreferrer'];
17
+ });
18
+ };
19
+ }
@@ -0,0 +1,74 @@
1
+ import type { Element, Root } from 'hast';
2
+ import { visit } from 'unist-util-visit';
3
+
4
+ interface TableWrapper {
5
+ type: string;
6
+ name?: string;
7
+ attributes?: Array<{
8
+ type: string;
9
+ name?: string;
10
+ value?: string | { value?: string } | null;
11
+ }>;
12
+ }
13
+
14
+ /** Add native table semantics using Astro's existing Markdown/MDX tree. */
15
+ export function rehypeContentTables() {
16
+ return (tree: Root) => {
17
+ visit(tree, 'element', (table, _index, parent) => {
18
+ if (table.tagName !== 'table') return;
19
+ const wrapper = parent as TableWrapper | undefined;
20
+ if (
21
+ wrapper?.type !== 'mdxJsxFlowElement' ||
22
+ wrapper.name !== 'ContentTable'
23
+ )
24
+ return;
25
+ const caption = wrapper.attributes?.find(
26
+ (attribute) => attribute.name === 'caption',
27
+ )?.value;
28
+ if (typeof caption !== 'string' || !caption.trim())
29
+ throw new Error('ContentTable requires a non-empty caption.');
30
+ if (
31
+ !table.children.some(
32
+ (child) =>
33
+ child.type === 'element' && child.tagName === 'caption',
34
+ )
35
+ )
36
+ table.children.unshift({
37
+ type: 'element',
38
+ tagName: 'caption',
39
+ properties: {},
40
+ children: [{ type: 'text', value: caption }],
41
+ });
42
+ visit(table, 'element', (cell) => {
43
+ if (cell.tagName === 'th') cell.properties.scope = 'col';
44
+ });
45
+ const highlight = wrapper.attributes?.find(
46
+ (attribute) => attribute.name === 'highlight',
47
+ );
48
+ if (!highlight) return;
49
+ const rowNumber = Number(
50
+ highlight.value && typeof highlight.value === 'object'
51
+ ? highlight.value.value
52
+ : undefined,
53
+ );
54
+ const body = table.children.find(
55
+ (child): child is Element =>
56
+ child.type === 'element' && child.tagName === 'tbody',
57
+ );
58
+ const rows =
59
+ body?.children.filter(
60
+ (child): child is Element =>
61
+ child.type === 'element' && child.tagName === 'tr',
62
+ ) ?? [];
63
+ if (
64
+ !Number.isInteger(rowNumber) ||
65
+ rowNumber < 1 ||
66
+ rowNumber > rows.length
67
+ )
68
+ throw new Error(
69
+ 'ContentTable highlight must refer to an existing body row.',
70
+ );
71
+ rows[rowNumber - 1].properties['data-highlighted'] = 'true';
72
+ });
73
+ };
74
+ }
@@ -0,0 +1,19 @@
1
+ import type { Root } from 'mdast';
2
+ import { visit } from 'unist-util-visit';
3
+ import { contentHref } from './urls.js';
4
+ import type { SiteConfig } from './types.js';
5
+
6
+ export function remarkContentLinks(site: SiteConfig) {
7
+ return (tree: Root, file: { path?: string }) => {
8
+ const locale =
9
+ site.locales.find((language) =>
10
+ ['md', 'mdx'].some((extension) =>
11
+ file.path?.endsWith(`.${language}.${extension}`),
12
+ ),
13
+ ) ?? site.language;
14
+ const documentSite = { ...site, language: locale };
15
+ visit(tree, 'link', (node) => {
16
+ node.url = contentHref(node.url, documentSite);
17
+ });
18
+ };
19
+ }
@@ -0,0 +1,110 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { resolve } from 'node:path';
3
+ import { z } from 'zod';
4
+ import { parse } from 'yaml';
5
+ import type { SiteConfig } from './types.js';
6
+
7
+ const linkSchema = z.object({
8
+ label: z.string().trim().min(1),
9
+ href: z.string().trim().min(1),
10
+ });
11
+ const headerLinkSchema = linkSchema.extend({
12
+ icon: z
13
+ .string()
14
+ .regex(
15
+ /^[A-Z][A-Za-z0-9]*$/,
16
+ 'must be a canonical PascalCase Lucide name',
17
+ )
18
+ .optional(),
19
+ });
20
+ const heroClass = z.string().regex(/^ss-[a-z0-9][a-z0-9_-]*$/, {
21
+ message:
22
+ 'must start with ss- and contain only lowercase letters, digits, underscores, or hyphens',
23
+ });
24
+
25
+ const siteSchema = z.object({
26
+ name: z.string().trim().min(1),
27
+ url: z.url(),
28
+ base: z
29
+ .string()
30
+ .regex(/^\/(?:[^/].*)?\/$|^\/$/, 'must be / or begin and end with /'),
31
+ language: z
32
+ .string()
33
+ .regex(/^[a-z]{2}(?:-[A-Z]{2})?$/, 'must be a BCP 47 language tag'),
34
+ locales: z
35
+ .array(z.string().regex(/^[a-z]{2}$/))
36
+ .min(1)
37
+ .default(['en']),
38
+ 'hero-classes': z.array(heroClass).max(8).default([]),
39
+ blog: z
40
+ .object({
41
+ title: z.string().trim().min(1),
42
+ description: z.string().trim().min(1),
43
+ eyebrow: z.string().trim().min(1),
44
+ heading: z.string().trim().min(1),
45
+ })
46
+ .optional(),
47
+ header: z.object({
48
+ links: z
49
+ .array(
50
+ z.union([
51
+ z.object({ type: z.literal('separator') }).strict(),
52
+ z.object({ type: z.literal('language-switcher') }).strict(),
53
+ headerLinkSchema
54
+ .extend({
55
+ type: z.literal('cta'),
56
+ variant: z
57
+ .enum([
58
+ 'primary',
59
+ 'secondary',
60
+ 'accent',
61
+ 'neutral',
62
+ 'info',
63
+ 'success',
64
+ 'warning',
65
+ 'error',
66
+ ])
67
+ .default('primary'),
68
+ })
69
+ .strict(),
70
+ headerLinkSchema
71
+ .extend({ type: z.literal('link').optional() })
72
+ .strict(),
73
+ ]),
74
+ )
75
+ .min(1)
76
+ .refine((items) => items.some((item) => 'href' in item), {
77
+ message: 'must contain at least one navigation link',
78
+ }),
79
+ }),
80
+ footer: z.object({
81
+ text: z.string().trim().min(1),
82
+ links: z.array(linkSchema),
83
+ }),
84
+ });
85
+
86
+ export function loadSiteConfig(
87
+ locale?: string,
88
+ root = process.cwd(),
89
+ ): SiteConfig {
90
+ const filename =
91
+ locale && locale !== 'en' ? `site.${locale}.yaml` : 'site.yaml';
92
+ const source = resolve(root, 'src/content', filename);
93
+ const raw = parse(readFileSync(source, 'utf8'));
94
+ const parsed = siteSchema.safeParse(raw);
95
+ if (!parsed.success) {
96
+ throw new Error(
97
+ `Invalid src/content/site.yaml: ${parsed.error.issues.map((issue) => `${issue.path.join('.')}: ${issue.message}`).join('; ')}`,
98
+ );
99
+ }
100
+ const { 'hero-classes': heroClasses, ...site } = parsed.data;
101
+ const config: SiteConfig = { ...site, heroClasses };
102
+ const environmentBase = process.env.SPROUTSITE_BASE;
103
+ if (environmentBase === undefined) return config;
104
+ const base = siteSchema.shape.base.safeParse(environmentBase);
105
+ if (!base.success)
106
+ throw new Error(
107
+ `Invalid SPROUTSITE_BASE: ${base.error.issues[0]?.message}`,
108
+ );
109
+ return { ...config, base: base.data };
110
+ }