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.
- package/LICENSE +202 -0
- package/NOTICE +14 -0
- package/README.md +604 -2
- package/THIRD_PARTY_NOTICES.md +85 -0
- package/VERSION +1 -0
- package/package.json +107 -5
- package/src/lib/sproutsite/colors.ts +7 -0
- package/src/lib/sproutsite/language-links.ts +60 -0
- package/src/lib/sproutsite/pages.ts +78 -0
- package/src/lib/sproutsite/rehype-ids.ts +20 -0
- package/src/lib/sproutsite/rehype-links.ts +19 -0
- package/src/lib/sproutsite/rehype-tables.ts +74 -0
- package/src/lib/sproutsite/remark-links.ts +19 -0
- package/src/lib/sproutsite/site-config.ts +110 -0
- package/src/lib/sproutsite/sitemap.ts +160 -0
- package/src/lib/sproutsite/types.ts +45 -0
- package/src/lib/sproutsite/urls.ts +79 -0
- package/src/lib/sproutsite/validation.ts +1406 -0
- package/src/package/404.astro +5 -0
- package/src/package/500.astro +5 -0
- package/src/package/components.ts +17 -0
- package/src/package/config.ts +161 -0
- package/src/package/content.ts +117 -0
- package/src/package/index.ts +3 -0
- package/src/package/manifest.ts +27 -0
- package/src/package/page.astro +124 -0
- package/src/themes/default/assets/branding/apple-touch-icon.png +0 -0
- package/src/themes/default/assets/branding/favicon-16x16.png +0 -0
- package/src/themes/default/assets/branding/favicon-32x32.png +0 -0
- package/src/themes/default/assets/branding/favicon-48x48.png +0 -0
- package/src/themes/default/assets/branding/favicon.ico +0 -0
- package/src/themes/default/assets/branding/favicon.svg +1 -0
- package/src/themes/default/assets/branding/icon-192x192.png +0 -0
- package/src/themes/default/assets/branding/icon-512x512.png +0 -0
- package/src/themes/default/assets/branding/icon-monochrome.svg +1 -0
- package/src/themes/default/assets/branding/icon.svg +18 -0
- package/src/themes/default/assets/branding/logo-dark.svg +18 -0
- package/src/themes/default/assets/branding/logo-monochrome.svg +1 -0
- package/src/themes/default/assets/branding/logo.svg +18 -0
- package/src/themes/default/assets/branding/social-card.png +0 -0
- package/src/themes/default/assets/hero-waves.svg +41 -0
- package/src/themes/default/components/atoms/Badge/Badge.astro +65 -0
- package/src/themes/default/components/atoms/Badge/Badge.css +5 -0
- package/src/themes/default/components/atoms/BrandLogo/BrandLogo.astro +26 -0
- package/src/themes/default/components/atoms/BrandLogo/BrandLogo.css +22 -0
- package/src/themes/default/components/atoms/Button/Button.astro +106 -0
- package/src/themes/default/components/atoms/Button/Button.css +14 -0
- package/src/themes/default/components/atoms/ContentImage/ContentImage.astro +54 -0
- package/src/themes/default/components/atoms/ContentImage/ContentImage.css +21 -0
- package/src/themes/default/components/atoms/Eyebrow/Eyebrow.astro +3 -0
- package/src/themes/default/components/atoms/Eyebrow/Eyebrow.css +18 -0
- package/src/themes/default/components/atoms/Icon/Icon.astro +80 -0
- package/src/themes/default/components/atoms/Icon/Icon.css +68 -0
- package/src/themes/default/components/atoms/Tab/Tab.astro +15 -0
- package/src/themes/default/components/atoms/Tab/Tab.css +34 -0
- package/src/themes/default/components/layout/Column/Column.astro +18 -0
- package/src/themes/default/components/layout/Column/Column.css +82 -0
- package/src/themes/default/components/layout/Columns/Columns.astro +163 -0
- package/src/themes/default/components/layout/Columns/Columns.css +177 -0
- package/src/themes/default/components/molecules/Accordion/Accordion.astro +17 -0
- package/src/themes/default/components/molecules/Accordion/Accordion.css +11 -0
- package/src/themes/default/components/molecules/Accordion/accordion.ts +47 -0
- package/src/themes/default/components/molecules/AccordionItem/AccordionItem.astro +100 -0
- package/src/themes/default/components/molecules/AccordionItem/AccordionItem.css +118 -0
- package/src/themes/default/components/molecules/Alert/Alert.astro +42 -0
- package/src/themes/default/components/molecules/Alert/Alert.css +13 -0
- package/src/themes/default/components/molecules/Card/Card.astro +57 -0
- package/src/themes/default/components/molecules/Card/Card.css +25 -0
- package/src/themes/default/components/molecules/CardActions/CardActions.astro +3 -0
- package/src/themes/default/components/molecules/CardActions/CardActions.css +13 -0
- package/src/themes/default/components/molecules/ContentTable/ContentTable.astro +42 -0
- package/src/themes/default/components/molecules/ContentTable/ContentTable.css +59 -0
- package/src/themes/default/components/molecules/Feature/Feature.astro +108 -0
- package/src/themes/default/components/molecules/Feature/Feature.css +157 -0
- package/src/themes/default/components/molecules/FoundationSample/FoundationSample.astro +165 -0
- package/src/themes/default/components/molecules/FoundationSample/FoundationSample.css +201 -0
- package/src/themes/default/components/molecules/LanguageSwitcher/LanguageSwitcher.astro +118 -0
- package/src/themes/default/components/molecules/LanguageSwitcher/LanguageSwitcher.css +134 -0
- package/src/themes/default/components/molecules/Tabs/Tabs.astro +33 -0
- package/src/themes/default/components/molecules/Tabs/Tabs.css +38 -0
- package/src/themes/default/components/molecules/Tabs/tabs.ts +91 -0
- package/src/themes/default/components/organisms/BlogIndex/BlogIndex.astro +86 -0
- package/src/themes/default/components/organisms/BlogIndex/BlogIndex.css +17 -0
- package/src/themes/default/components/organisms/BlogPost/BlogPost.astro +51 -0
- package/src/themes/default/components/organisms/BlogPost/BlogPost.css +5 -0
- package/src/themes/default/components/organisms/Footer/Footer.astro +57 -0
- package/src/themes/default/components/organisms/Footer/Footer.css +63 -0
- package/src/themes/default/components/organisms/Header/Header.astro +223 -0
- package/src/themes/default/components/organisms/Header/Header.css +282 -0
- package/src/themes/default/components/organisms/Hero/Hero.astro +106 -0
- package/src/themes/default/components/organisms/Hero/Hero.css +187 -0
- package/src/themes/default/components/organisms/PageTitle/PageTitle.astro +39 -0
- package/src/themes/default/components/organisms/PageTitle/PageTitle.css +25 -0
- package/src/themes/default/components/organisms/Section/Section.astro +39 -0
- package/src/themes/default/components/organisms/Section/Section.css +21 -0
- package/src/themes/default/i18n/de.yaml +38 -0
- package/src/themes/default/i18n/en.yaml +38 -0
- package/src/themes/default/i18n/index.ts +63 -0
- package/src/themes/default/layouts/ErrorPage/ErrorPage.astro +110 -0
- package/src/themes/default/layouts/PageLayout/PageLayout.astro +108 -0
- package/src/themes/default/layouts/PageLayout/PageLayout.css +15 -0
- package/src/themes/default/styles/foundation/base.css +19 -0
- package/src/themes/default/styles/foundation/focus.css +6 -0
- package/src/themes/default/styles/foundation/fonts/OFL.txt +93 -0
- package/src/themes/default/styles/foundation/fonts/nunito-latin-variable.woff2 +0 -0
- package/src/themes/default/styles/foundation/fonts.css +17 -0
- package/src/themes/default/styles/foundation/layout.css +6 -0
- package/src/themes/default/styles/foundation/prose.css +54 -0
- package/src/themes/default/styles/foundation/tokens.css +48 -0
- package/src/themes/default/styles/theme.css +99 -0
- package/src/themes/default/styles/themes/section-tones.css +30 -0
- package/third-party-licenses/daisyui-LICENSE +21 -0
- package/third-party-licenses/flag-icons-LICENSE +21 -0
- package/third-party-licenses/lucide-LICENSE +43 -0
- package/third-party-licenses/tailwindcss-LICENSE +21 -0
- package/third-party-licenses/tailwindcss-typography-LICENSE +21 -0
package/README.md
CHANGED
|
@@ -1,3 +1,605 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Sproutsite
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/sproutsite/sproutsite/releases)
|
|
4
|
+
|
|
5
|
+
**Sproutsite — The Agent-Ready Static CMS**
|
|
6
|
+
|
|
7
|
+
Agent-ready, Markdown-first Static CMS powered by Astro and TypeScript.
|
|
8
|
+
|
|
9
|
+
Sproutsite is an npm-based developer tool for file-based content, page structures, and reusable components. External coding agents such as Codex or Claude Code can edit the repository; **Sproutsite itself contains no AI agent**. There is no traditional CMS administration backend. Astro generates a static website that needs no CMS server runtime, while Git keeps content changes reviewable.
|
|
10
|
+
|
|
11
|
+
_Plant an idea. Grow your website._
|
|
12
|
+
|
|
13
|
+
Official website: [sproutsite.dev](https://sproutsite.dev) · [Documentation](https://sproutsite.dev/documentation/) · [Component showcase](https://sproutsite.dev/showcase/) · [Source code](https://github.com/sproutsite/sproutsite)
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
Use Sproutsite in your own Astro project. You maintain the content files; the package provides the content model, page assembly, and default theme. An initial project setup is required before authors can edit pages. There is no project generator or administration interface.
|
|
18
|
+
|
|
19
|
+
Requires Node.js 24 or later. The current package supports Astro 7 and MDX 8; the commands below use the tested peer-dependency ranges.
|
|
20
|
+
|
|
21
|
+
Before the first npm release, use a local archive as described under [Testing a Local Package](#testing-a-local-package) instead of installing `sproutsite` from the registry. The package has not been published yet.
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
mkdir my-website
|
|
25
|
+
cd my-website
|
|
26
|
+
npm init -y
|
|
27
|
+
npm install sproutsite astro@^7.4.4 @astrojs/mdx@^8.1.2
|
|
28
|
+
npm install --save-dev @astrojs/check typescript
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
In your project's `package.json`, set `"type": "module"` and add these scripts, preserving the other fields:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"type": "module",
|
|
36
|
+
"scripts": {
|
|
37
|
+
"dev": "astro dev",
|
|
38
|
+
"check": "astro check",
|
|
39
|
+
"build": "astro build",
|
|
40
|
+
"preview": "astro preview"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
These are consumer-project scripts. Sproutsite's repository has additional development and publication checks described below.
|
|
46
|
+
|
|
47
|
+
## Set Up Your Website
|
|
48
|
+
|
|
49
|
+
Create these files in your project:
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
my-website/
|
|
53
|
+
├── astro.config.ts
|
|
54
|
+
├── package.json
|
|
55
|
+
├── tsconfig.json
|
|
56
|
+
└── src/
|
|
57
|
+
├── content.config.ts
|
|
58
|
+
├── pages/
|
|
59
|
+
│ └── [...slug].astro
|
|
60
|
+
└── content/
|
|
61
|
+
├── site.yaml
|
|
62
|
+
└── pages/
|
|
63
|
+
├── page.yaml
|
|
64
|
+
├── hero.md
|
|
65
|
+
└── 01-introduction.md
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`astro.config.ts`:
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
import { defineConfig } from 'astro/config';
|
|
72
|
+
import { createSproutsiteConfig } from 'sproutsite/config';
|
|
73
|
+
|
|
74
|
+
export default defineConfig(createSproutsiteConfig());
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
This configuration registers MDX, the default theme's Tailwind integration, sitemap, and error pages. You do not need to add separate MDX or Tailwind integrations for this setup. In an existing Astro project, merge the setup carefully and remove routes that would conflict with Sproutsite's generated pages, such as a starter `src/pages/index.astro`.
|
|
78
|
+
|
|
79
|
+
`tsconfig.json`:
|
|
80
|
+
|
|
81
|
+
```json
|
|
82
|
+
{
|
|
83
|
+
"extends": "astro/tsconfigs/strict"
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
`src/content.config.ts`:
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
import { createSproutsiteCollections } from 'sproutsite/content';
|
|
91
|
+
|
|
92
|
+
export const collections = createSproutsiteCollections();
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
`src/pages/[...slug].astro`:
|
|
96
|
+
|
|
97
|
+
```astro
|
|
98
|
+
---
|
|
99
|
+
import SproutsitePage, { getSproutsiteStaticPaths } from 'sproutsite/page';
|
|
100
|
+
|
|
101
|
+
export async function getStaticPaths() {
|
|
102
|
+
return getSproutsiteStaticPaths();
|
|
103
|
+
}
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
<SproutsitePage {...Astro.props} />
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
`src/content/site.yaml`:
|
|
110
|
+
|
|
111
|
+
```yaml
|
|
112
|
+
name: My website
|
|
113
|
+
url: https://example.com
|
|
114
|
+
base: /
|
|
115
|
+
language: en
|
|
116
|
+
locales: [en]
|
|
117
|
+
header:
|
|
118
|
+
links:
|
|
119
|
+
- label: Home
|
|
120
|
+
href: /
|
|
121
|
+
footer:
|
|
122
|
+
text: My website, built with Sproutsite.
|
|
123
|
+
links:
|
|
124
|
+
- label: Home
|
|
125
|
+
href: /
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Replace `name`, `url`, and the footer copy with your own details. `url` is your production origin, even during local development. A visible Sproutsite attribution is optional. Set `base` if the website will be hosted under a subpath, for example `/demo/`.
|
|
129
|
+
|
|
130
|
+
`src/content/pages/page.yaml`:
|
|
131
|
+
|
|
132
|
+
```yaml
|
|
133
|
+
title: My website
|
|
134
|
+
description: Practical notes and updates from our team.
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
`src/content/pages/hero.md`:
|
|
138
|
+
|
|
139
|
+
```md
|
|
140
|
+
---
|
|
141
|
+
title: Welcome to our website
|
|
142
|
+
eyebrow: Our team
|
|
143
|
+
type: small
|
|
144
|
+
tone: brand
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
Find our latest notes, project updates, and useful resources.
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
`src/content/pages/01-introduction.md`:
|
|
151
|
+
|
|
152
|
+
```md
|
|
153
|
+
---
|
|
154
|
+
tone: default
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Notes from our team
|
|
158
|
+
|
|
159
|
+
This is our first page. Edit this file to update the website.
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Write, Preview, and Publish
|
|
163
|
+
|
|
164
|
+
Run `npm run dev` and open the local address printed by Astro. Edit Markdown files under `src/content/` to change the page content. Add a directory with `page.yaml` and numbered sections to create another page; add its link to `site.yaml` when it should appear in navigation. An optional `hero.md` supplies the page's introductory area.
|
|
165
|
+
|
|
166
|
+
Use `.mdx` sections when you need documented components such as cards, columns, features, or accordions:
|
|
167
|
+
|
|
168
|
+
```mdx
|
|
169
|
+
import { Feature } from 'sproutsite/components';
|
|
170
|
+
|
|
171
|
+
## What you can find here
|
|
172
|
+
|
|
173
|
+
<Feature icon="BookOpen" title="Team notes">
|
|
174
|
+
Practical guides maintained alongside our project.
|
|
175
|
+
</Feature>
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Keep the content in your project and commit it to Git. An external coding agent can help edit these files; Sproutsite does not run an agent or translate content automatically. The installed package supplies the default theme and its components, while custom component or design development remains a developer task.
|
|
179
|
+
|
|
180
|
+
```sh
|
|
181
|
+
npm run check
|
|
182
|
+
npm run build
|
|
183
|
+
npm run preview
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Deploy the complete `dist/` directory to your static host. The build includes the website, local assets, sitemap, manifest, and `404.html`/`500.html` error documents. Configure your web server to use those error documents; generated files do not configure Apache or Nginx automatically. See [Deployment](https://sproutsite.dev/documentation/deployment/) and [Error Pages](#error-pages).
|
|
187
|
+
|
|
188
|
+
The sections below describe the content format and component options. Repository development and release checks follow under [Developing Sproutsite](#developing-sproutsite).
|
|
189
|
+
|
|
190
|
+
## Maintaining Content
|
|
191
|
+
|
|
192
|
+
For a compact QR or advertising entry page, set `layout: landing` in `page.yaml`, omit `hero.md`, and supply exactly one visible H1 in the section content. The content can start with an image. This layout omits the header and automatic title area; the normal footer and shared components remain available. All other pages use `layout: default` automatically.
|
|
193
|
+
|
|
194
|
+
`src/content/site.yaml` contains the name, production URL, base path, language, navigation, and footer. In `header.links`, add an entry with `type: separator` between links to display a decorative vertical line styled with CSS. Separators inherit the navigation text color, including after scrolling, and are hidden from assistive technology. Localized navigation in `site.de.yaml` supports the same syntax:
|
|
195
|
+
|
|
196
|
+
```yaml
|
|
197
|
+
header:
|
|
198
|
+
links:
|
|
199
|
+
- label: Blog
|
|
200
|
+
href: /blog/
|
|
201
|
+
- type: separator
|
|
202
|
+
- type: language-switcher
|
|
203
|
+
- type: cta
|
|
204
|
+
icon: Mail
|
|
205
|
+
variant: primary
|
|
206
|
+
label: Contact
|
|
207
|
+
href: /contact/
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Header links use `type: link` by default; it may be omitted. Set `type: cta` to render a navigation link with the shared Button component. Its optional `variant` defaults to `primary` and accepts `primary`, `secondary`, `accent`, `neutral`, `info`, `success`, `warning`, or `error`. CTA entries retain normal link behavior, locale and base handling, and the active page indication. `variant` applies only to CTA entries; separators use only `type: separator`.
|
|
211
|
+
|
|
212
|
+
Both regular header links and CTAs accept an optional `icon`, using a canonical PascalCase Lucide name such as `Mail`, `BookOpen`, or `Sprout`. The icon appears before the label and inherits its color. It is decorative for screen readers because the visible label already names the link. Omit `icon` for a text-only entry. Unknown names stop the build; separators do not accept icons.
|
|
213
|
+
|
|
214
|
+
Add `type: language-switcher` to `header.links` to show the native disclosure dropdown. It lists the project's configured `locales`, including when there is only one language. Content IDs match translated pages and blog articles even when their URL segments differ; missing counterparts link to the target language's homepage. Astro's `getRelativeLocaleUrl()` supplies the language prefix and deployment base. The existing content convention supports English and German; it does not discover or translate new languages automatically. Language names use their native spelling. Flags are local SVGs from MIT-licensed `flag-icons` (GB for English, DE for German); languages are identified by text, not flags alone. The selector works without JavaScript; a small processed Astro script adds Escape and outside-click dismissal. Removing the configuration entry removes the selector.
|
|
215
|
+
|
|
216
|
+
Below 72rem, the header uses a hamburger button and a fullscreen native `<dialog>`. It reuses the same configured navigation, with an inline language selector and full-width CTA. A compact language selector also remains available in the closed header when configured. Native modal focus handling, Escape, localized open/close labels, scroll locking, and desktop resize restoration are supported. Without JavaScript, the ordinary wrapping navigation remains accessible. The desktop layout is unchanged.
|
|
217
|
+
|
|
218
|
+
Every page is a directory under `src/content/pages/`:
|
|
219
|
+
|
|
220
|
+
```text
|
|
221
|
+
pages/
|
|
222
|
+
├── page.yaml # homepage
|
|
223
|
+
├── hero.md # optional
|
|
224
|
+
├── 01-introduction.md # start at 01, then number sections consecutively
|
|
225
|
+
└── faq/
|
|
226
|
+
├── page.yaml
|
|
227
|
+
└── 01-questions.md
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
`page.yaml` requires a non-empty `title` and `description`. Both values are used for HTML metadata: `title` becomes the `<title>` tag and `description` becomes the meta description. Without `url`, its directory becomes the URL directly: `faq/page.yaml` becomes `/faq/`; a deeper `services/monitoring/page.yaml` becomes `/services/monitoring/`. The optional single URL segment `url` lets an English source path retain a localized public URL: `documentation/page.yaml` with `url: dokumentation` produces `/dokumentation/`. URL segments of parent pages are also considered for child pages.
|
|
231
|
+
|
|
232
|
+
A `hero.md` activates the shared hero and requires a frontmatter `title`, rendered as the visible `h1`. `titleHighlight` may select one text fragment from that title for the theme highlight. `hero-classes` in `site.yaml` may optionally set up to eight theme classes for each hero and for the H1 fallback view without `hero.md`. A `classes` list in an individual `hero.md` completely overrides that global list; `classes: null` removes global classes for that hero. Classes must begin with `ss-`, for example `ss-hero--visual`, so a theme can add gradients, overlays, or textures. `background-image` optionally references a local image relative to `hero.md`; Astro validates it and emits an optimized decorative hero image. `claim` adds a prominent line below the title. `actions` optionally defines one or two Button-based calls to action with `label`, `href`, and `variant: primary|secondary`; `tagline` adds a short line below them. If these settings are omitted, the hero receives no additional image or actions. Delete the file to render `page.yaml.title` as a compact visible H1 fallback above the sections; it still receives global `hero-classes`. Sections must be named `NN-name.md`, begin with an `h2`, and may set `tone: default`, `muted`, or `brand` in frontmatter. By default, `ss-section__content` constrains content to a readable width. `fullWidth: true` in section frontmatter removes this inner constraint; the shared outer `site-shell` and Markdown typography remain active. For numbered page and blog sections, `tone` also accepts an object with both `odd` and `even`. Each value is `default`, `muted`, or `brand`. The numeric filename prefix selects the tone, including translated files; it does not depend on the section's position in the page. Scalar tones remain fixed, and omitting `tone` still means `default`. Heroes only accept scalar tones. Use a YAML mapping, not a list:
|
|
233
|
+
|
|
234
|
+
```yaml
|
|
235
|
+
tone:
|
|
236
|
+
odd: default
|
|
237
|
+
even: muted
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Section frontmatter may also set `spacing: small | default | large`. Omitted spacing means `default`, preserving the existing padding. From 64rem viewport width, `small` halves and `large` doubles both top and bottom padding; below 64rem, all variants retain the original mobile padding. This applies to numbered page and blog sections, independently of tone and content width, and does not affect heroes. The theme exposes `ss-section--spacing-small`, `ss-section--spacing-default`, and `ss-section--spacing-large`. See `/showcase/sections/` for live examples. Internal links always stay website-root-relative, for example `/faq/`; Sproutsite applies `base` exactly once. Heading IDs are derived from file names and headings, for example `01-introduction-inhalte-direkt-im-projekt-pflegen`, so anchor links remain unique across assembled Markdown files.
|
|
241
|
+
|
|
242
|
+
The optional hero frontmatter `type` accepts `small` (the default), `big`, or `fullscreen`. It adds `ss-hero--small`, `ss-hero--big`, or `ss-hero--fullscreen` alongside the existing theme classes. Both homepage translations explicitly use `big`; other heroes default to `small`. The blog overview and compact H1 fallback also receive `ss-hero--small`. The `big` variant adds more top spacing. Other variant-specific styling is still being prepared; `small` retains the base presentation, and `fullscreen` does not yet force a viewport-height hero.
|
|
243
|
+
|
|
244
|
+
```md
|
|
245
|
+
---
|
|
246
|
+
title: Beispiel-Hero
|
|
247
|
+
type: small
|
|
248
|
+
titleHighlight: Hero
|
|
249
|
+
tone: brand
|
|
250
|
+
classes:
|
|
251
|
+
- ss-hero--visual
|
|
252
|
+
background-image: ./_assets/hero-visual.png
|
|
253
|
+
claim: A memorable message.
|
|
254
|
+
actions:
|
|
255
|
+
- label: Get started
|
|
256
|
+
href: /dokumentation/einstieg/
|
|
257
|
+
variant: primary
|
|
258
|
+
tagline: A short supporting claim.
|
|
259
|
+
---
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
English and German content can be maintained in the same project. Configure `locales: [en, de]` in `site.yaml`, add `site.de.yaml` with German navigation and the same production URL/base, and add translated `page.de.yaml`, `hero.de.md`, and numbered `.de.md`/`.de.mdx` sections. Add `src/pages/de/[...slug].astro` using the same page component and an async `getStaticPaths()` wrapper that calls `getSproutsiteStaticPaths('de')`. Each locale uses its own copy and optional URL segments; translations are not generated automatically. Keep section numbers aligned between languages.
|
|
263
|
+
|
|
264
|
+
To deliberately remove global hero classes, use:
|
|
265
|
+
|
|
266
|
+
```md
|
|
267
|
+
---
|
|
268
|
+
title: Hero ohne globale Theme-Klassen
|
|
269
|
+
classes: null
|
|
270
|
+
---
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
For tested layout building blocks, Sproutsite also supports MDX sections with the `.mdx` extension. Install this direct peer dependency in the consumer project:
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
npm install @astrojs/mdx
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
The first standard building block is a responsive 12-column layout:
|
|
280
|
+
|
|
281
|
+
```mdx
|
|
282
|
+
import { Column, Columns } from 'sproutsite/components';
|
|
283
|
+
|
|
284
|
+
<Columns>
|
|
285
|
+
<Column span={8}>
|
|
286
|
+
|
|
287
|
+
## Hauptinhalt
|
|
288
|
+
|
|
289
|
+
Dieser Bereich nimmt acht von zwölf Spalten ein.
|
|
290
|
+
|
|
291
|
+
</Column>
|
|
292
|
+
|
|
293
|
+
<Column span={4}>
|
|
294
|
+
|
|
295
|
+
Dieser Bereich ergänzt den Hauptinhalt auf vier Spalten.
|
|
296
|
+
|
|
297
|
+
</Column>
|
|
298
|
+
|
|
299
|
+
</Columns>
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
The file would be named `01-introduction.mdx`. Areas stack on mobile; from desktop widths onward, a 12-column grid applies. A `Columns` block contains one or more direct `Column` elements. `Column` accepts `span={1}` through `span={12}`; without a value, a column occupies the full width (`12`). Columns automatically continue on the next row when the next span no longer fits in the twelve available grid tracks. Eight columns with `span={4}`, for example, form rows of three, three, and two elements. Smaller totals intentionally leave empty space. The grid gap controls both horizontal and vertical spacing. For every Columns layout, `gap` accepts `xs` (0.5rem), `sm` (1rem), `md` (2rem, the existing gap without separators), `lg` (4rem), or `xl` (6rem). `gapMobile` optionally overrides the value below 64rem. Plain columns inherit the same gap on mobile. Existing divider layouts keep their prior defaults and half-sized mobile fallback. A divider or icon uses this same gap, never an additional gap. Existing `dividerGap` / `dividerGapMobile` remain supported; explicit `gap` / `gapMobile` take precedence over them for each axis. For example, `<Columns gap="xl" gapMobile="sm">` creates 6rem gaps on desktop and 1rem gaps on mobile without any separator. See `/showcase/layout/` for examples. Add `<Columns divider>` for subtle gray separators between adjacent columns, or `<Columns divider dividerColor="#94a3b8">` for a custom CSS hex color (3, 4, 6, or 8 digits). With dividers enabled, `dividerGap` accepts `xs` (2rem), `sm` (4rem), `md` (6rem, default), `lg` (8rem), or `xl` (12rem). Half the total gap sits on either side of the line. Set `dividerGap="lg"` for 8rem; it affects both column and row gaps. Below 64rem, `dividerGapMobile` optionally overrides the gap between stacked columns; each mobile preset uses half its desktop value, and when omitted the mobile gap is half of `dividerGap`. For example, `<Columns divider dividerGap="xl" dividerGapMobile="md">` uses 12rem on desktop and 3rem when stacked. Both values scale with the root font size. Presets use theme CSS modifiers such as `ss-columns--divider-gap-xl` and `ss-columns--divider-gap-mobile-md`, rather than inline spacing values. Vertical lines have a 20% inset at both ends. On mobile, divider lines run horizontally between stacked areas. `separator="MoveRight"` replaces the line with a decorative Lucide icon; any canonical icon name, such as `Plus` or `ChevronRight`, can be used. It also works without `divider` and takes precedence when both are set. `separatorAlign="centered"` (default) centers icons against the whole column. `separatorAlign="top"` aligns their centers with a direct vertical Feature icon, or 1.75rem below the column top for other content; mobile positioning stays between stacked areas. The icon uses the same spacing presets and optional `dividerColor`, defaults to the primary theme color, and rotates 90 degrees on mobile. Icons only appear between adjacent columns in the same desktop row, or between stacked columns on mobile. They progressively enhance the static content via a locally rendered Icon template and the existing processed browser script; without JavaScript the icons are omitted. With dividers, equivalent twelve-span flex rows keep large gaps between actual content areas rather than between all twelve internal grid tracks. Desktop row starts have no separator; a small processed TypeScript script uses ResizeObserver to identify actual row boundaries for arbitrary spans without clipping focus outlines or shadows. Without JavaScript, mobile separators remain visible and desktop separators are omitted.
|
|
303
|
+
|
|
304
|
+
Common balanced distributions are `12` (one column), `6 + 6` (two columns), `4 + 4 + 4` (three columns), and `3 + 3 + 3 + 3` (four columns). Asymmetric distributions such as `8 + 4` or `7 + 5` are equally valid. New layout components always require an Astro component, a documented export, and documented usage.
|
|
305
|
+
|
|
306
|
+
The first DaisyUI component is `Alert`. Import it in an MDX section; it accepts optional `variant="info|success|warning|error"` and `style="normal|soft|outline|dash"` props:
|
|
307
|
+
|
|
308
|
+
```mdx
|
|
309
|
+
import { Alert } from 'sproutsite/components';
|
|
310
|
+
|
|
311
|
+
<Alert variant="success" style="soft">
|
|
312
|
+
**Gespeichert:** Die Änderungen wurden übernommen.
|
|
313
|
+
</Alert>
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
Local content images belong beside their page or in a shared local `_assets/` directory, for example `src/content/pages/showcase/_assets/`. The `_` prefix marks a support-only directory: it must not contain `page.yaml` and therefore cannot generate a page. `ContentImage` imports these PNG, JPEG, WebP, or AVIF files relatively from MDX and sends them through Astro’s asset pipeline as WebP at quality 80. The component accepts `width`, `height`, `fullWidth`, `shape="rounded|square"`, and `border="default|none"`; when width and height are specified, it uses `object-fit: cover`.
|
|
317
|
+
|
|
318
|
+
```mdx
|
|
319
|
+
import layoutImage from '../_assets/layout.png';
|
|
320
|
+
import { ContentImage } from 'sproutsite/components';
|
|
321
|
+
|
|
322
|
+
<ContentImage
|
|
323
|
+
src={layoutImage}
|
|
324
|
+
alt="Description of the image content"
|
|
325
|
+
width={720}
|
|
326
|
+
height={260}
|
|
327
|
+
fullWidth
|
|
328
|
+
shape="rounded"
|
|
329
|
+
border="default"
|
|
330
|
+
/>
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
`Card` combines an optional local image, Markdown content, and actions. Its first direct `###` heading receives the DaisyUI card-title style. `CardActions` is optional; all Markdown links inside it render as consistent primary buttons. Use `shadow="none|sm|md|lg|xl"` to configure elevation; `sm` is the default.
|
|
334
|
+
|
|
335
|
+
```mdx
|
|
336
|
+
import cardImage from './images/card.png';
|
|
337
|
+
import { Card, CardActions } from 'sproutsite/components';
|
|
338
|
+
|
|
339
|
+
<Card image={cardImage} imageAlt="Description of the image content" shadow="md">
|
|
340
|
+
### Card title
|
|
341
|
+
|
|
342
|
+
Multiple Markdown paragraphs are supported.
|
|
343
|
+
|
|
344
|
+
<CardActions>
|
|
345
|
+
[Learn more](/info/)
|
|
346
|
+
</CardActions>
|
|
347
|
+
|
|
348
|
+
</Card>
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
`Button` renders a semantic link when `href` is provided and a real button otherwise. It accepts `variant="primary|secondary|accent|neutral|info|success|warning|error"`, `style="solid|outline|soft|ghost|link"`, `size="xs|sm|md|lg|xl"`, `type="button|submit|reset"`, and the Boolean `disabled` for button actions. Links deliberately cannot be disabled.
|
|
352
|
+
|
|
353
|
+
```mdx
|
|
354
|
+
import { Button } from 'sproutsite/components';
|
|
355
|
+
|
|
356
|
+
<Button href="/contact/">Contact</Button>
|
|
357
|
+
<Button variant="secondary" style="outline">
|
|
358
|
+
Save draft
|
|
359
|
+
</Button>
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
`Badge` labels compact status values or categories. It accepts `variant="default|primary|secondary|accent|neutral|info|success|warning|error"`, `style="solid|outline|soft|dash"`, and `size="xs|sm|md|lg|xl"`.
|
|
363
|
+
|
|
364
|
+
```mdx
|
|
365
|
+
import { Badge } from 'sproutsite/components';
|
|
366
|
+
|
|
367
|
+
Build status: <Badge variant="success" style="soft">ready</Badge>
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
`Tabs` and `Tab` display Markdown panels with DaisyUI styling. `Tabs` requires a non-empty accessible `label` and one or more direct `Tab` children, each with a non-empty `title`. Optional `variant` supports `border` (default), `box`, and `lift`; `initial` is a one-based index (default `1`) and must refer to an existing panel.
|
|
371
|
+
|
|
372
|
+
```mdx
|
|
373
|
+
import { Tabs, Tab } from 'sproutsite/components';
|
|
374
|
+
|
|
375
|
+
<Tabs label="Product information" variant="border" initial={1}>
|
|
376
|
+
<Tab title="Overview">
|
|
377
|
+
|
|
378
|
+
An overview with **Markdown**.
|
|
379
|
+
|
|
380
|
+
</Tab>
|
|
381
|
+
<Tab title="Details">
|
|
382
|
+
|
|
383
|
+
Additional information.
|
|
384
|
+
|
|
385
|
+
</Tab>
|
|
386
|
+
|
|
387
|
+
</Tabs>
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
Tabs progressively enhance static panels: all content remains readable without JavaScript. With JavaScript, each group has its own selection and linked tab/panel semantics. Arrow keys wrap between tabs, Home/End select the first/last tab, and Tab moves into the active panel. Long tab lists scroll horizontally. See `/showcase/tabs/` for examples. The implementation uses [DaisyUI tabs](https://daisyui.com/components/tab/) and the [WAI-ARIA tabs pattern](https://www.w3.org/WAI/ARIA/apg/patterns/tabs/).
|
|
391
|
+
|
|
392
|
+
Fenced code blocks use Astro's built-in Shiki highlighter. Specify the language after the opening fence, for example `mdx`, `typescript`, `yaml`, or `css`. The configuration preloads MDX and its embedded TSX grammar so imports, components, attributes, and Markdown receive their respective syntax colors. Highlighting runs at build time and needs no browser library. Restart the development server after changing the shared Astro configuration.
|
|
393
|
+
|
|
394
|
+
## Features
|
|
395
|
+
|
|
396
|
+
The default theme's `Feature` molecule pairs a decorative Lucide icon with a heading and a short Markdown description:
|
|
397
|
+
|
|
398
|
+
```mdx
|
|
399
|
+
import { Feature } from 'sproutsite/components';
|
|
400
|
+
|
|
401
|
+
<Feature icon="Zap" title="Static output">
|
|
402
|
+
Prebuilt pages that can be served by static hosting.
|
|
403
|
+
</Feature>
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
`icon` is a canonical Lucide component name; `title` is required. `layout` accepts `horizontal` (default, icon left of the text), `vertical` (icon above centered text), or `card` (icon above left-aligned text on a shared padded, rounded surface). For card layout, the whole background defaults to 8% icon color and 92% transparent, `backgroundColor` sets that entire surface, the icon has no separate box, and `variant` is ignored. Other layouts retain their existing background rules. All layouts support the same colors and heading levels; visual variants apply only to horizontal and vertical layouts. `iconSize` accepts `xs`, `sm`, `md` (default), `lg`, or `xl`. Symbols measure 14, 21, 28, 42, or 56px; boxes measure 1.75, 2.625, 3.5, 5.25, or 7rem respectively. `xs` is half the default size and `xl` doubles it. Text sizes remain unchanged. `variant` accepts `soft` (default), `solid`, or `plain`. `color` uses `primary` (default), `secondary`, `accent`, `neutral`, `info`, `success`, `warning`, or `error`, or a CSS hex value with 3, 4, 6, or 8 digits. Hex values always use the custom icon color with a softly tinted background and ignore `variant`. Set `backgroundColor="#E9EFDF"` to choose an explicit hex background instead; it overrides the variant background. `headingLevel` defaults to `3` and accepts numeric values from `2` to `6`; match it to the enclosing section. A section may begin directly with features using `headingLevel={2}`, without a separate Markdown heading. Combine features with the existing `Columns`/`Column` layout for responsive groups. Examples are available at `/showcase/features/` and `/de/showcase/features/`, and in Storybook.
|
|
407
|
+
|
|
408
|
+
## Icons
|
|
409
|
+
|
|
410
|
+
Use the default theme's `Icon` atom in MDX or Astro:
|
|
411
|
+
|
|
412
|
+
```mdx
|
|
413
|
+
import { Icon } from 'sproutsite/components';
|
|
414
|
+
|
|
415
|
+
<Icon name="Sprout" size={24} />
|
|
416
|
+
<Icon name="CircleCheck" color="success" label="Published" />
|
|
417
|
+
<Icon name="Sprout" size={32} background="primary" label="Growth" />
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
The local `@lucide/astro` dependency renders inline SVGs without browser JavaScript, icon fonts, or CDN requests. `name` uses the canonical PascalCase component name from the [Lucide catalog](https://lucide.dev/icons/), such as `ArrowRight`; unknown names stop rendering with an error. Optional `size` (default `24`) and `strokeWidth` (default `2`) are positive numbers. `color` defaults to inherited text color; supported theme colors are `primary`, `secondary`, `accent`, `info`, `success`, `warning`, and `error`.
|
|
421
|
+
|
|
422
|
+
Set `background` to `primary`, `secondary`, `accent`, `neutral`, `info`, `success`, `warning`, or `error` for a padded square with slightly rounded corners. The matching content color is applied automatically unless `color` explicitly overrides it. `size` controls the symbol's dimensions; padding increases the outer square. Without `background`, the icon remains unboxed.
|
|
423
|
+
|
|
424
|
+
Omit `label` beside explanatory text: the icon is then decorative (`aria-hidden`). For meaningful standalone icons, provide a non-empty `label` to render an accessible image name. Icons do not provide interactive behavior. In MDX, only these documented props are accepted; children, arbitrary classes, and executable expressions are rejected. The wrapper resolves the registry during the build; it does not ship the registry to browsers. Direct individual Lucide imports in theme `.astro` files remain available when build-time tree-shaking is preferred. See `/showcase/icons/` (German: `/de/showcase/icons/`) for previews and copyable examples. Lucide's separate license notices are retained in `third-party-licenses/lucide-LICENSE`.
|
|
425
|
+
|
|
426
|
+
## Structure and Theme
|
|
427
|
+
|
|
428
|
+
External HTTP(S) links automatically receive `target="_blank"` and `rel="noopener noreferrer"`, including Markdown reference/autolinks and header/footer links. External means a different origin from the validated production URL in `site.yaml`, so preview builds use the same classification. Internal/same-origin links, fragments, `mailto:`, and `tel:` retain their normal behavior. Authors do not add link attributes in content.
|
|
429
|
+
|
|
430
|
+
`ContentTable` wraps exactly one Markdown table in an MDX section. Its required `caption` becomes a native table caption. Optional props are `variant="plain|striped"`, `density="comfortable|compact"`, a boolean `wide` flag, and a one-based `highlight={2}` body-row index. Keep blank lines between the component tags and Markdown table. Column alignment uses standard Markdown colons. `wide` preserves a minimum table width of 60rem inside a keyboard-focusable horizontal scroll region.
|
|
431
|
+
|
|
432
|
+
```mdx
|
|
433
|
+
import { ContentTable } from 'sproutsite/components';
|
|
434
|
+
|
|
435
|
+
<ContentTable caption="Example projects" variant="striped">
|
|
436
|
+
|
|
437
|
+
| Project | Status | Pages |
|
|
438
|
+
| :--- | :---: | ---: |
|
|
439
|
+
| North | Draft | 12 |
|
|
440
|
+
| South | Reviewed | 8 |
|
|
441
|
+
|
|
442
|
+
</ContentTable>
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
This MDX component requires the Sproutsite configuration: a small rehype transform adds the caption, column-header scopes, and optional row marker to Astro's existing table AST. Validation uses `remark-gfm` to inspect the same Markdown table structure. No custom table parser or browser JavaScript is needed. Plain Markdown tables remain supported; `/showcase/tables/` demonstrates the enhanced component.
|
|
446
|
+
|
|
447
|
+
`FoundationSample` is a fixed visual theme specimen exported from `sproutsite/components`. Its required `kind` prop accepts `colors`, `type`, `spacing`, `radius`, `shadow`, or `focus`; it accepts no other props or children. For example, `<FoundationSample kind="colors" />` displays labeled swatches using the actual theme variables. It illustrates the theme rather than providing a general layout language. `/showcase/foundations/` contains live specimens and usage/CSS examples; the detailed token reference lives on `/documentation/theme/`.
|
|
448
|
+
|
|
449
|
+
The small reusable content and URL logic lives in `src/lib/sproutsite/`. It knows neither demo text nor Tailwind or DaisyUI classes. The default theme lives in `src/themes/default/` and includes the layout, header, hero, sections, and footer. DaisyUI is actively used there for navigation and theme elements.
|
|
450
|
+
|
|
451
|
+
The entry point for the default theme is `src/themes/default/styles/theme.css`. It documents the import order and remains the only central import. Global foundations live in `styles/foundation/`, semantic content variants in `styles/themes/`. Components follow Atomic Design: `atoms/`, `molecules/`, `organisms/`, and `layout/` for technical layout primitives. Every visible building block is organized locally as a pair, for example `components/organisms/Header/Header.astro` and `components/organisms/Header/Header.css`; `layouts/PageLayout/` follows the same pattern. Theme-owned classes begin with `ss-`, for example `ss-header` and `ss-header__inner`. The default theme is named `sproutsite`, intentionally light, and centrally defines semantic DaisyUI tokens, font sizes, spacing, radii, and shadows in its theme and foundation files.
|
|
452
|
+
|
|
453
|
+
Another theme can replace these components and the technical CSS integration without migrating Markdown or YAML. This is not yet a configurable theme loader and deliberately does not claim every UI library can be switched through a setting.
|
|
454
|
+
|
|
455
|
+
## Accordions
|
|
456
|
+
|
|
457
|
+
Import `{ Accordion, AccordionItem }` from `sproutsite/components` in an MDX section. `Accordion` accepts `multiple` (boolean, default false) and direct `AccordionItem` children. Items require `title`, accept `open` and an optional canonical PascalCase Lucide `icon`, and render Markdown in their default slot. Use at most one initially open item unless `multiple` is true.
|
|
458
|
+
|
|
459
|
+
`color` accepts Feature's semantic colors or validated CSS hex colors, defaulting to primary. Icon geometry matches Feature's medium size. `backgroundColor` overrides the icon box's default 8% color tint. `surfaceColor`, `openSurfaceColor`, and `openBorderColor` accept CSS hex colors for the closed background and open background/border; defaults are white/gray when closed and a light blue surface/blue border when open.
|
|
460
|
+
|
|
461
|
+
```mdx
|
|
462
|
+
import { Accordion, AccordionItem } from 'sproutsite/components';
|
|
463
|
+
|
|
464
|
+
<Accordion>
|
|
465
|
+
<AccordionItem title="Does Sproutsite contain an agent?" icon="Layers" open>
|
|
466
|
+
No. Your external coding agent edits files in the repository.
|
|
467
|
+
</AccordionItem>
|
|
468
|
+
<AccordionItem title="Do I need a CMS server?">
|
|
469
|
+
No. Deploy the static output.
|
|
470
|
+
</AccordionItem>
|
|
471
|
+
</Accordion>
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
Native details/summary provides keyboard operation. A small processed TypeScript module scopes single-open behavior to each group and closes open items when clicking noninteractive answer areas. Links, buttons, and text selection remain usable. Without JavaScript, headings still toggle items; whole-answer closing and single-open grouping are progressive enhancements. Do not nest Accordion groups. Custom colors need their own contrast review. See `/showcase/accordions/` for bilingual live examples and Storybook's Molecules/Accordion and Molecules/AccordionItem for controls.
|
|
475
|
+
|
|
476
|
+
## Sitemap
|
|
477
|
+
|
|
478
|
+
The configured Astro build generates `dist/sitemap.xml` using the official Astro sitemap integration. It lists every regular page and blog article with its absolute canonical URL, `lastmod`, and reciprocal `xhtml:link` language alternatives. Translations are matched by content identity, including different URL segments such as `/documentation/` and `/de/dokumentation/`; missing translations are not replaced with homepage links. `x-default` points to the existing default-language version. Error pages are excluded.
|
|
479
|
+
|
|
480
|
+
`lastmod` uses the latest Git commit touching a page's source directory or applicable site configuration. Local edits and untracked sources use their file modification timestamps when later. The blog overview considers article metadata. Without available Git history, source modification times are the fallback; preserve meaningful timestamps in exported source archives. These dates describe content/configuration changes, not every rebuild or a full dependency/theme change audit.
|
|
481
|
+
|
|
482
|
+
The existing `sitemap-index.xml` and `sitemap-0.xml` remain valid. `sitemap.xml` exposes the generated URL list directly; if the integration splits a large site into multiple chunks, it exposes the sitemap index instead. The document head links to `/sitemap.xml`, respecting the configured deployment base. No custom XML serializer is used.
|
|
483
|
+
|
|
484
|
+
## Error Pages
|
|
485
|
+
|
|
486
|
+
The default theme registers standard Astro custom 404 and 500 routes. In `npm run dev`, open `/404` or `/500` to preview the corresponding error page without triggering a server failure. Unknown URLs render the custom 404 page with HTTP status 404. Both pages reuse the small Hero, header, and footer. Agent references in their playful copy are fictional; Sproutsite contains no integrated agent.
|
|
487
|
+
|
|
488
|
+
`npm run build` emits `dist/404.html` and `dist/500.html` in the default language. Each additional configured language gets flat files with a language suffix: with English as default and German enabled, `dist/404-de.html` and `dist/500-de.html`. Development previews use `/404`, `/500`, `/de/404`, and `/de/500`; the localized preview directories are not retained in the build. All error pages are marked `noindex` and excluded from the sitemap. During development, the 404 also uses German for unknown `/de/` URLs when German is configured. A static host needs its own error-document configuration, including selection of the localized file; generating HTML does not configure the server or simulate server failures. Astro renders the localized routes normally, and a small build hook moves their HTML files to the server-friendly filenames.
|
|
489
|
+
|
|
490
|
+
For an Apache site whose document root contains `dist/`, configure local error documents:
|
|
491
|
+
|
|
492
|
+
```apache
|
|
493
|
+
ErrorDocument 404 /404.html
|
|
494
|
+
ErrorDocument 500 /500.html
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
For an Nginx server with the same document root:
|
|
498
|
+
|
|
499
|
+
```nginx
|
|
500
|
+
error_page 404 /404.html;
|
|
501
|
+
error_page 500 /500.html;
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
These local error documents preserve the original error status. For a subpath deployment, prefix the error-document URLs with the deployment base (for example `/demo/404.html`). Error pages still load their shared CSS, logo, and scripts from the generated asset directory, so deploy the complete build. See the official [Astro error-page documentation](https://docs.astro.build/en/basics/astro-pages/), [Apache ErrorDocument reference](https://httpd.apache.org/docs/2.4/mod/core.html#errordocument), and [Nginx error_page reference](https://nginx.org/en/docs/http/ngx_http_core_module.html#error_page).
|
|
505
|
+
|
|
506
|
+
## Validation and Limitations
|
|
507
|
+
|
|
508
|
+
A new website without blog articles currently emits warnings about a missing or empty blog collection. The build still generates an empty blog overview; these warnings do not prevent the regular pages from building.
|
|
509
|
+
|
|
510
|
+
The demo keeps English showcase and documentation sources in the standard files and German translations in their `.de.md`, `.de.mdx`, and `page.de.yaml` counterparts. English routes use `/showcase/` and `/documentation/`; German routes use `/de/showcase/` and `/de/dokumentation/`, including localized URL segments. Keep both versions up to date when editing examples, labels, image descriptions, or metadata. Markdown links use the source file's locale, and Button applies the active locale and deployment base exactly once. Theme messages are bundled from the local YAML files using Vite raw imports; they are not read from paths relative to generated build chunks.
|
|
511
|
+
|
|
512
|
+
The accessibility script discovers all generated page routes and checks both languages on mobile and desktop. To investigate specific pages, set `SPROUTSITE_A11Y_ROUTES` to a comma-separated list of generated routes before running `node --import tsx scripts/test-a11y.ts`; omit it for the complete run. Build verification also checks internal page and fragment targets in both languages, including under `/demo/`.
|
|
513
|
+
|
|
514
|
+
The validator checks directory association, YAML fields, file names, tones, duplicate section numbers, Markdown hierarchy, raw HTML, disallowed link protocols, internal link targets, and generated heading IDs. The build checks all generated pages, metadata, canonicals, the sitemap, and base prefixes. Project-owned program logic is TypeScript only; `npm run test:source` checks this too.
|
|
515
|
+
|
|
516
|
+
Accessibility testing automates axe, visible keyboard focus, and mobile overflow checks. It does not replace a complete WCAG 2.2 AA conformance assessment or editorial review of headings and link text.
|
|
517
|
+
|
|
518
|
+
The public package exports and local archive installation checks are implemented. Registry publication remains a separate explicit step. A project generator and optional extensions remain outside the scope of this milestone.
|
|
519
|
+
|
|
520
|
+
## Testing a Local Package
|
|
521
|
+
|
|
522
|
+
Before registry publication, or when testing changes to the library, create an archive in the Sproutsite repository:
|
|
523
|
+
|
|
524
|
+
```sh
|
|
525
|
+
npm pack
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
Use the filename printed by npm. In your separate consumer project, replace the registry installation command with:
|
|
529
|
+
|
|
530
|
+
```sh
|
|
531
|
+
npm install /absolute/path/to/sproutsite-VERSION.tgz astro@^7.4.4 @astrojs/mdx@^8.1.2
|
|
532
|
+
npm install --save-dev @astrojs/check typescript
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
Replace `VERSION` with the packed version, then follow the same configuration and content setup above. The archive contains the library and default theme, not the demo content, repository scripts, or Storybook. Install it in a separate directory rather than into the Sproutsite checkout.
|
|
536
|
+
|
|
537
|
+
## Developing Sproutsite
|
|
538
|
+
|
|
539
|
+
Node.js 24 LTS or later is required. `.nvmrc` pins Node.js 24.22.2 for local development.
|
|
540
|
+
|
|
541
|
+
```sh
|
|
542
|
+
git clone https://github.com/sproutsite/sproutsite.git
|
|
543
|
+
cd sproutsite
|
|
544
|
+
npm install
|
|
545
|
+
npm run dev
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
The dev server deliberately starts with `--force`, so changes to Content Collections, MDX components, and local package files are checked without an outdated Astro content cache.
|
|
549
|
+
|
|
550
|
+
The running demo documents itself at `/documentation/` (German: `/de/dokumentation/`): it contains setup, the content contract, layout components, theme, checks, and local package use. The visible [showcase](https://sproutsite.dev/showcase/) instead collects component examples.
|
|
551
|
+
The [blog](https://sproutsite.dev/blog/) is a small, file-based project journal. Each article lives in a `YYYY-MM-DD.article-slug/` directory in `src/content/blog/` and uses the same `page.yaml`, `hero.md`, and numbered sections as a normal page. `page.yaml` validates the title, description, date, local card image, and alternative text; the date prefix orders source directories while the URL only uses `article-slug`. Astro generates the overview and article routes from the collection, and every section supports the usual tones and documented MDX components.
|
|
552
|
+
|
|
553
|
+
The optional `blog` setting in `site.yaml` accepts `title`, `eyebrow`, `description`, and `heading` (all non-empty strings) to customize the blog overview. The demo configures English overview copy in `site.yaml` and German copy in `site.de.yaml`. Without this setting, the theme supplies neutral, localized fallback text. Article links use “Learn more” or “Mehr erfahren” and include the article title in their accessible name.
|
|
554
|
+
|
|
555
|
+
English articles use `page.yaml`, `hero.md`, and numbered sections; their German counterparts use `page.de.yaml`, `hero.de.md`, and `.de.mdx` sections in the same article directory. Each pair keeps its publication date, image, and slug; titles, descriptions, alternative text, heroes, and body copy are maintained separately. `/blog/` and `/de/blog/` list their respective language versions. Dates use the site's language and UTC so a date-only publication value does not shift on hosts in another time zone.
|
|
556
|
+
|
|
557
|
+
Additional commands:
|
|
558
|
+
|
|
559
|
+
```sh
|
|
560
|
+
npm run check # content contract plus Astro and TypeScript checks
|
|
561
|
+
npm test # small unit tests for URL conventions
|
|
562
|
+
npm run build # validated static build to dist/
|
|
563
|
+
npm run preview # preview the build
|
|
564
|
+
npm run test:a11y # Playwright, axe, keyboard focus, and mobile width
|
|
565
|
+
npm run build:demo # builds once with base /demo/
|
|
566
|
+
npm run storybook # isolated Astro component workshop on port 6006
|
|
567
|
+
npm run build:storybook # static Storybook output to storybook-static/
|
|
568
|
+
npm run test:package # install and build the local archive in a fresh consumer
|
|
569
|
+
npm run prepublishOnly # run all publication checks without publishing
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
Storybook is a local developer tool and not part of the published website. It renders the existing `.astro` components with the default Sproutsite theme. Stories live in `stories/`, use TypeScript, and directly import their corresponding component. The initial set covers `Button`, `Badge`, `Alert`, `Card`, and `ContentImage`; add a story whenever a reusable component or meaningful variant is introduced. The running demo documents the workflow at `/documentation/storybook/`.
|
|
573
|
+
|
|
574
|
+
`npm run build:demo` sets `SPROUTSITE_BASE=/demo/` only for that command; `src/content/site.yaml` remains unchanged. The product website uses `https://sproutsite.dev`; consumer projects must configure their own production URL. Before deployment, check indexability and any staging protection. `robots.txt` is not access control.
|
|
575
|
+
|
|
576
|
+
The product identity is consistently Sproutsite: package imports use `sproutsite/*`, public helpers use `createSproutsiteCollections()`, `createSproutsiteConfig()` and `getSproutsiteStaticPaths()`, and theme classes use the `ss-` prefix. Update local consumers' dependency, imports, environment variables and custom theme overrides together.
|
|
577
|
+
|
|
578
|
+
### Logo and icons
|
|
579
|
+
|
|
580
|
+
The reference-based sprout and three-layer symbol lives in `src/themes/default/assets/branding/`. `logo.svg` (navy wordmark), `logo-dark.svg` (white wordmark), `logo-monochrome.svg`, `icon.svg`, and `icon-monochrome.svg` are standalone vector assets with transparent backgrounds and outlined Nunito lettering. They need no external font. The shared `BrandLogo` atom uses the existing locally hosted Nunito font, inherits the light/dark text color, and is used in the header and footer. Consumer sites with a different `site.name` retain their own text wordmark.
|
|
581
|
+
|
|
582
|
+
`favicon.svg` uses flat colors for small displays. The ICO contains native 16, 32, and 48 pixel frames; separate PNGs provide those sizes too. The Apple touch icon is 180 pixels; web app icons are 192 and 512 pixels, with navy backgrounds and safe internal padding. `PageLayout` links the icons and the static `/site.webmanifest` endpoint registered by `createSproutsiteConfig()` through Astro's standard `injectRoute()` API. Imported asset URLs and the configured base are respected; no CMS runtime or service worker is added. These are the default theme's icons; a differently branded consumer should replace them when replacing the theme. The Sproutsite social card is emitted only for the product site (`site.name: Sproutsite`).
|
|
583
|
+
|
|
584
|
+
Brand colors are separate `--color-brand-*` tokens in `styles/foundation/tokens.css`; the existing semantic UI palette is unchanged. Run `npm run branding:generate` after changing the vector geometry or brand tokens, then `npm run format`. The TypeScript generator uses `fontkit` and `sharp` only during development. Its local source font is `scripts/assets/nunito-variable.ttf` from the [official Nunito distribution](https://github.com/google/fonts/tree/main/ofl/nunito), covered by the adjacent SIL Open Font License. Generated assets are committed and ordinary builds do not regenerate or download them.
|
|
585
|
+
|
|
586
|
+
## Publication Checks
|
|
587
|
+
|
|
588
|
+
Run `npm run test:package` to test the actual npm archive in a fresh consumer project. It checks package metadata/version consistency, required exports and license files, and exclusion of demo/development files. It then installs the local tarball (not a registry package named Sproutsite), runs Astro/TypeScript checking, and builds the consumer for `/` and `/demo/`. The fixture exercises English/German routes, a Markdown section, an MDX accordion with a Lucide icon, theme CSS and fonts, version display, error documents, manifest, and multilingual sitemap. It also verifies that the installed library is a real copy rather than a symlink to this checkout.
|
|
589
|
+
|
|
590
|
+
The test uses `scripts/fixtures/package-consumer/`, pins its direct Astro/MDX/checking dependencies to versions in the repository lockfile, and lets npm resolve the library's published dependency ranges. npm may need network access and uses its normal cache. Temporary files are removed after success and retained with their path printed after failure. Lifecycle scripts are suppressed during packing and installation to prevent recursive publication checks and ensure the archive already contains everything it needs. During `npm publish --dry-run`, the nested checks still create and install a real local archive; only their child processes override the inherited dry-run setting, so the outer publication remains a dry run.
|
|
591
|
+
|
|
592
|
+
`npm run prepublishOnly` runs formatting, TypeScript-source enforcement, content/Astro checking, unit tests, the demo build/output checks, and the consumer installation test. npm runs this gate automatically before publishing from this repository; any failing command stops the sequence. Neither running the gate manually nor running the package test publishes anything. A normal `npm pack` remains separate from this gate. Run the existing Storybook and accessibility checks as well when changing components or interactions. Do not bypass the gate with `--ignore-scripts` when publishing; publishing an existing tarball also requires checking that exact artifact beforehand.
|
|
593
|
+
|
|
594
|
+
## License
|
|
595
|
+
|
|
596
|
+
Sproutsite is licensed under the Apache License, Version 2.0.
|
|
597
|
+
|
|
598
|
+
Copyright © 2026 Björn Hempel.
|
|
599
|
+
|
|
600
|
+
See [LICENSE](LICENSE) for the full license text and
|
|
601
|
+
[NOTICE](NOTICE) for attribution information.
|
|
602
|
+
|
|
603
|
+
This declaration covers first-party source code. The maintainer has also authorized Apache-2.0 licensing of the project's branding assets, their generated icon variants and social card, and `hero-waves.svg`, to the extent he holds rights that he can license. Their AI-assisted provenance and derivation are recorded in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md). Third-party software and fonts retain their own licenses. Other demo illustrations with unresolved provenance or licensing are not automatically covered by this artwork authorization; see the same file for scope and outstanding checks.
|
|
604
|
+
|
|
605
|
+
The software license does not grant general trademark rights to the Sproutsite name, domain, or logos; see Section 6 of the license. No visible Sproutsite attribution in a generated website's footer is required by Apache 2.0.
|