sproutsite 0.5.13 → 0.5.15

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 (34) hide show
  1. package/README.md +23 -1
  2. package/THIRD_PARTY_NOTICES.md +4 -0
  3. package/VERSION +1 -1
  4. package/package.json +3 -1
  5. package/src/lib/sproutsite/legal-identity.ts +85 -0
  6. package/src/lib/sproutsite/privacy-infrastructure.ts +70 -0
  7. package/src/lib/sproutsite/rehype-links.ts +24 -5
  8. package/src/lib/sproutsite/site-config.ts +54 -1
  9. package/src/lib/sproutsite/types.ts +16 -1
  10. package/src/lib/sproutsite/urls.ts +31 -0
  11. package/src/lib/sproutsite/validation.ts +56 -0
  12. package/src/package/components.ts +2 -0
  13. package/src/package/config.ts +7 -1
  14. package/src/themes/default/assets/arrow-up-right.svg +2 -0
  15. package/src/themes/default/assets/footer-waves.svg +38 -0
  16. package/src/themes/default/components/atoms/Button/Button.astro +16 -3
  17. package/src/themes/default/components/molecules/Card/Card.css +4 -0
  18. package/src/themes/default/components/molecules/Feature/Feature.css +4 -0
  19. package/src/themes/default/components/molecules/LanguageSwitcher/LanguageSwitcher.astro +13 -3
  20. package/src/themes/default/components/molecules/LanguageSwitcher/LanguageSwitcher.css +25 -0
  21. package/src/themes/default/components/molecules/LegalIdentity/LegalIdentity.astro +92 -0
  22. package/src/themes/default/components/molecules/LegalIdentity/LegalIdentity.css +22 -0
  23. package/src/themes/default/components/molecules/PrivacyInfrastructure/PrivacyInfrastructure.astro +89 -0
  24. package/src/themes/default/components/molecules/PrivacyInfrastructure/PrivacyInfrastructure.css +16 -0
  25. package/src/themes/default/components/organisms/Footer/Footer.astro +127 -32
  26. package/src/themes/default/components/organisms/Footer/Footer.css +208 -27
  27. package/src/themes/default/components/organisms/Header/Header.astro +8 -12
  28. package/src/themes/default/components/organisms/Header/Header.css +4 -4
  29. package/src/themes/default/layouts/PageLayout/PageLayout.astro +7 -2
  30. package/src/themes/default/styles/foundation/base.css +5 -0
  31. package/src/themes/default/styles/foundation/links.css +28 -0
  32. package/src/themes/default/styles/foundation/prose.css +6 -1
  33. package/src/themes/default/styles/theme.css +3 -0
  34. package/third-party-licenses/simple-icons-LICENSE +30 -0
package/README.md CHANGED
@@ -234,6 +234,8 @@ Add `type: language-switcher` to `header.links` to show the native disclosure dr
234
234
 
235
235
  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.
236
236
 
237
+ The footer supports optional `groups` (`title` and `links` with optional Lucide `icon`), `social` (`title` and icon links with `platform`, `label`, `href`), `copyright`, `showVersion` and `languageSwitcher`. Supported social platforms are `github`, `instagram` and `facebook`; logos are rendered locally from CC0-licensed Simple Icons. Existing `footer.text` and `footer.links` remain supported; `links` is the lower utility row. Version visibility defaults to `true`, language selection to `false`; omitting groups or socials hides those areas. The footer language dropdown opens upward and uses the same translated-page matching as the header. See [Global website settings](https://sproutsite.dev/documentation/content/) for a complete YAML example.
238
+
237
239
  Every page is a directory under `src/content/pages/`:
238
240
 
239
241
  ```text
@@ -444,7 +446,9 @@ Omit `label` beside explanatory text: the icon is then decorative (`aria-hidden`
444
446
 
445
447
  ## Structure and Theme
446
448
 
447
- 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.
449
+ Any link with `target="_blank"` must include both `noopener` and `noreferrer` in `rel`, even for same-origin destinations. Button and Markdown rendering preserve other relationship tokens while adding these protections. The repository's `npm run build` verifies all generated HTML pages and reports unsafe native anchors with their file and destination. This requirement also applies when automatic external new tabs are disabled and a new tab is explicitly requested.
450
+
451
+ Theme components use native `<a>` elements. External HTTP(S) links receive `target="_blank"` and `rel="noopener noreferrer"` by default, including Markdown reference/autolinks and header/footer links. Set `links.externalNewTab: false` in `site.yaml` to retain native same-tab behavior for automatically handled links. Explicit Button `target`/`rel` props remain available. External means a different origin from the validated production URL, including in preview builds. Internal/same-origin links, fragments, `mailto:` and `tel:` retain their normal behavior. Links are underlined only on hover. Set `links.externalIcon: true` to add a compact CSS-only Lucide arrow to external, email and telephone links; omission means no arrows. The two settings are independent and both are enabled in this demo's English and German site files. No Link component or browser-side anchor rewriting is needed.
448
452
 
449
453
  `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.
450
454
 
@@ -594,6 +598,24 @@ Storybook is a local developer tool and not part of the published website. It re
594
598
 
595
599
  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.
596
600
 
601
+ ### Legal details for the demo website
602
+
603
+ The legal-notice pages read operator details from a local `.env`. Copy `.env.dist` to `.env` and enter your details before running `npm run build`. `.env` is ignored by Git; `.env.dist` contains example values for version control. Without `.env`, `npm run dev` displays clearly marked sample details. Builds of pages using `LegalIdentity` reject a missing file, incomplete/invalid fields, or the sample name, email and LinkedIn profile. Consumer websites without this component do not require these variables. Generated HTML intentionally contains the legal details for publication.
604
+
605
+ ```sh
606
+ cp .env.dist .env
607
+ ```
608
+
609
+ Required keys: `LEGAL_NAME`, `LEGAL_STREET`, `LEGAL_POSTAL_CODE`, `LEGAL_CITY`, `LEGAL_COUNTRY` (two-letter country code), `LEGAL_EMAIL` and `LEGAL_LINKEDIN`. The component reads only `.env`, not `.env.local` or inherited shell variables, so the validated file and rendered identity stay consistent. Restart the dev server after editing `.env`.
610
+
611
+ Import `{ LegalIdentity }` from `sproutsite/components` in MDX: `<LegalIdentity />` renders address/contact cards; `part="controller"` omits LinkedIn for the privacy policy, `part="name"` inserts the operator's name, and `part="email"` renders a mailto link. The component reuses Columns and Feature. Node's native `.env` parser reads the values server-side; unrelated environment variables are not included in the output. There is no Markdown variable substitution.
612
+
613
+ The privacy policy additionally uses `{ PrivacyInfrastructure }` from the same export. Its default `part="hosting"` shows the provider and server location. `part="log-size-limit"`, `part="log-retention"` and `part="email-retention"` render the configured size, log period and email period. Fill the `PRIVACY_HOST_*`, `PRIVACY_SERVER_*`, `PRIVACY_LOG_SIZE_LIMIT_MIB` and `PRIVACY_EMAIL_RETENTION_MONTHS` keys documented in `.env.dist`; builds using this component reject missing, invalid or unchanged example hosting data. Sites without this component do not need these fields.
614
+
615
+ Leave `PRIVACY_LOG_RETENTION_DAYS` empty until a time-based policy is implemented. Empty means an unresolved-period notice, not zero-day retention. A number applies to the configured nginx access/error logs and shared Traefik operational/error logs during normal operation. It is not a blanket commitment for all server data or stopped-service periods. The demo describes hourly rotation, five-minute age cleanup and deferred cleanup on the next start. Operational details: nginx maintenance failures are exposed through a healthcheck; Traefik's Copytruncate rotation can lose individual diagnostic entries. External copies and backups still need separate retention verification. `PRIVACY_LOG_SIZE_LIMIT_MIB` is the approximate additional size limit in MiB, independently of age-based deletion. These fields document actual operation; they do not configure deletion.
616
+
617
+ `PRIVACY_EMAIL_RETENTION_MONTHS=6` records a chosen maximum for completed ordinary enquiries in the active mailbox, not a universal statutory period or an automatic mailbox rule. Verify retention of any copies/backups separately. Review the hosting data-processing agreement where applicable; this repository does not assert that a contract has already been concluded.
618
+
597
619
  ### Logo and icons
598
620
 
599
621
  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.
@@ -19,10 +19,14 @@ Both existing `OFL.txt` files are retained unchanged. The source font is from th
19
19
 
20
20
  ## Dependency licenses and notices
21
21
 
22
+ Footer social logos (GitHub, Instagram and Facebook) are rendered locally from `simple-icons` 16.38.0, distributed under [CC0 1.0 Universal](third-party-licenses/simple-icons-LICENSE). The full, unmodified upstream license is retained. Brand names and logos remain subject to their respective trademark rights; CC0 does not grant trademark rights. No remote icon service or social embed is loaded. The footer-wave SVG in `src/themes/default/assets/footer-waves.svg` was supplied by the maintainer on 2026-11-18; its separate provenance and redistribution permissions have not yet been confirmed. The existing hero-wave authorization should not be assumed to cover this new file.
23
+
22
24
  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
25
 
24
26
  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
27
 
28
+ The default theme also includes Lucide's ArrowUpRight paths in `src/themes/default/assets/arrow-up-right.svg` for the shared CSS link indicator. The same Lucide license applies.
29
+
26
30
  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
31
 
28
32
  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.
package/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.13
1
+ 0.5.15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sproutsite",
3
- "version": "0.5.13",
3
+ "version": "0.5.15",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Björn Hempel",
6
6
  "description": "Agent-ready, Markdown-first Static CMS powered by Astro and TypeScript.",
@@ -75,6 +75,7 @@
75
75
  "remark-gfm": "^4.0.1",
76
76
  "remark-mdx": "^3.1.1",
77
77
  "remark-parse": "^11.0.0",
78
+ "simple-icons": "^16.38.0",
78
79
  "tailwindcss": "^4.3.3",
79
80
  "unified": "^11.0.5",
80
81
  "unist-util-visit": "^5.1.0",
@@ -93,6 +94,7 @@
93
94
  "astro": "^7.4.12",
94
95
  "axe-core": "^4.13.0",
95
96
  "fontkit": "^2.0.4",
97
+ "hast-util-from-html": "^2.1.0",
96
98
  "playwright": "^1.63.0",
97
99
  "prettier": "^3.9.10",
98
100
  "prettier-plugin-astro": "^1.1.2",
@@ -0,0 +1,85 @@
1
+ import { existsSync, readFileSync } from 'node:fs';
2
+ import { resolve } from 'node:path';
3
+ import { parseEnv } from 'node:util';
4
+ import { z } from 'zod';
5
+
6
+ const text = z
7
+ .string()
8
+ .trim()
9
+ .min(1)
10
+ .max(200)
11
+ .regex(/^[^\r\n]+$/);
12
+ const schema = z.object({
13
+ LEGAL_NAME: text,
14
+ LEGAL_STREET: text,
15
+ LEGAL_POSTAL_CODE: text,
16
+ LEGAL_CITY: text,
17
+ LEGAL_COUNTRY: z
18
+ .string()
19
+ .trim()
20
+ .regex(/^[A-Z]{2}$/),
21
+ LEGAL_EMAIL: z.email(),
22
+ LEGAL_LINKEDIN: z.url().refine((value) => {
23
+ try {
24
+ const url = new URL(value);
25
+ return (
26
+ url.protocol === 'https:' &&
27
+ ['www.linkedin.com', 'linkedin.com'].includes(url.hostname) &&
28
+ url.pathname.startsWith('/in/')
29
+ );
30
+ } catch {
31
+ return false;
32
+ }
33
+ }, 'must be an HTTPS LinkedIn profile URL'),
34
+ });
35
+
36
+ export const legalIdentityExamples = {
37
+ LEGAL_NAME: 'Max Mustermann',
38
+ LEGAL_STREET: 'Musterstraße 123',
39
+ LEGAL_POSTAL_CODE: '12345',
40
+ LEGAL_CITY: 'Musterstadt',
41
+ LEGAL_COUNTRY: 'DE',
42
+ LEGAL_EMAIL: 'kontakt@example.com',
43
+ LEGAL_LINKEDIN: 'https://www.linkedin.com/in/example/',
44
+ } as const;
45
+
46
+ /** Read only .env, without mutating process.env or exposing unrelated values. */
47
+ export function loadLegalIdentity(
48
+ requireComplete = false,
49
+ root = process.cwd(),
50
+ ) {
51
+ const file = resolve(root, '.env');
52
+ const present = existsSync(file);
53
+ const raw = present ? parseEnv(readFileSync(file, 'utf8')) : {};
54
+ const values = { ...legalIdentityExamples } as Record<
55
+ keyof typeof legalIdentityExamples,
56
+ string
57
+ >;
58
+ const invalid: string[] = [];
59
+ for (const key of Object.keys(schema.shape) as (keyof typeof values)[]) {
60
+ const result = schema.shape[key].safeParse(raw[key]);
61
+ if (result.success) values[key] = result.data;
62
+ else invalid.push(key);
63
+ }
64
+ const exampleIdentity =
65
+ values.LEGAL_NAME === legalIdentityExamples.LEGAL_NAME ||
66
+ values.LEGAL_EMAIL.endsWith('@example.com') ||
67
+ values.LEGAL_LINKEDIN === legalIdentityExamples.LEGAL_LINKEDIN;
68
+ if (
69
+ requireComplete &&
70
+ (!present || invalid.length > 0 || exampleIdentity)
71
+ ) {
72
+ const reason = !present
73
+ ? '.env is missing'
74
+ : invalid.length > 0
75
+ ? `missing or invalid fields: ${invalid.join(', ')}`
76
+ : 'example identity values must be replaced';
77
+ throw new Error(
78
+ `Legal identity: ${reason}. Copy .env.dist to .env and complete the operator details before building.`,
79
+ );
80
+ }
81
+ return {
82
+ values,
83
+ placeholder: !present || invalid.length > 0 || exampleIdentity,
84
+ };
85
+ }
@@ -0,0 +1,70 @@
1
+ import { existsSync, readFileSync } from 'node:fs';
2
+ import { resolve } from 'node:path';
3
+ import { parseEnv } from 'node:util';
4
+ import { z } from 'zod';
5
+
6
+ const text = z
7
+ .string()
8
+ .trim()
9
+ .min(1)
10
+ .max(300)
11
+ .regex(/^[^\r\n]+$/);
12
+ const schema = z.object({
13
+ PRIVACY_HOST_NAME: text,
14
+ PRIVACY_HOST_ADDRESS: text,
15
+ PRIVACY_HOST_URL: z.url().refine((value) => value.startsWith('https://')),
16
+ PRIVACY_HOST_PRIVACY_URL: z
17
+ .url()
18
+ .refine((value) => value.startsWith('https://')),
19
+ PRIVACY_SERVER_CITY: text,
20
+ PRIVACY_SERVER_COUNTRY: z.string().regex(/^[A-Z]{2}$/),
21
+ PRIVACY_LOG_SIZE_LIMIT_MIB: z.string().regex(/^[1-9]\d*$/),
22
+ PRIVACY_LOG_RETENTION_DAYS: z
23
+ .string()
24
+ .regex(/^(?:|[1-9]\d*)$/)
25
+ .default(''),
26
+ PRIVACY_EMAIL_RETENTION_MONTHS: z.string().regex(/^[1-9]\d*$/),
27
+ });
28
+ const examples = {
29
+ PRIVACY_HOST_NAME: 'Example Hosting GmbH',
30
+ PRIVACY_HOST_ADDRESS: 'Musterstraße 1, 12345 Musterstadt, Deutschland',
31
+ PRIVACY_HOST_URL: 'https://hosting.example.com',
32
+ PRIVACY_HOST_PRIVACY_URL: 'https://hosting.example.com/privacy',
33
+ PRIVACY_SERVER_CITY: 'Musterstadt',
34
+ PRIVACY_SERVER_COUNTRY: 'DE',
35
+ PRIVACY_LOG_SIZE_LIMIT_MIB: '100',
36
+ PRIVACY_LOG_RETENTION_DAYS: '',
37
+ PRIVACY_EMAIL_RETENTION_MONTHS: '6',
38
+ } as const;
39
+
40
+ /** Separate from legal identity: only pages using hosting details need these keys. */
41
+ export function loadPrivacyInfrastructure(
42
+ requireComplete = false,
43
+ root = process.cwd(),
44
+ ) {
45
+ const file = resolve(root, '.env');
46
+ const present = existsSync(file);
47
+ const raw = present ? parseEnv(readFileSync(file, 'utf8')) : {};
48
+ const values = { ...examples } as Record<keyof typeof examples, string>;
49
+ const invalid: string[] = [];
50
+ for (const key of Object.keys(schema.shape) as (keyof typeof values)[]) {
51
+ const result = schema.shape[key].safeParse(raw[key]);
52
+ if (result.success) values[key] = result.data;
53
+ else invalid.push(key);
54
+ }
55
+ const example =
56
+ values.PRIVACY_HOST_NAME === examples.PRIVACY_HOST_NAME ||
57
+ values.PRIVACY_HOST_URL === examples.PRIVACY_HOST_URL ||
58
+ values.PRIVACY_SERVER_CITY === examples.PRIVACY_SERVER_CITY;
59
+ if (requireComplete && (!present || invalid.length > 0 || example)) {
60
+ const reason = !present
61
+ ? '.env is missing'
62
+ : invalid.length > 0
63
+ ? `missing or invalid fields: ${invalid.join(', ')}`
64
+ : 'example hosting values must be replaced';
65
+ throw new Error(
66
+ `Privacy infrastructure: ${reason}. Complete the hosting details from .env.dist before building.`,
67
+ );
68
+ }
69
+ return { values, placeholder: !present || invalid.length > 0 || example };
70
+ }
@@ -1,9 +1,14 @@
1
1
  import type { Root } from 'hast';
2
2
  import { visit } from 'unist-util-visit';
3
- import { isExternalWebLink } from './urls.js';
3
+ import { isExternalWebLink, secureLinkRel } from './urls.js';
4
4
 
5
5
  /** Apply the same external-link behavior after Markdown references and autolinks resolve. */
6
- export function rehypeExternalLinks(siteUrl: string) {
6
+ export function rehypeExternalLinks(
7
+ options: string | { url: string; externalNewTab?: boolean },
8
+ ) {
9
+ const siteUrl = typeof options === 'string' ? options : options.url;
10
+ const externalNewTab =
11
+ typeof options === 'string' || options.externalNewTab !== false;
7
12
  return (tree: Root) => {
8
13
  visit(tree, 'element', (node) => {
9
14
  if (
@@ -11,9 +16,23 @@ export function rehypeExternalLinks(siteUrl: string) {
11
16
  typeof node.properties.href !== 'string'
12
17
  )
13
18
  return;
14
- if (!isExternalWebLink(node.properties.href, siteUrl)) return;
15
- node.properties.target = '_blank';
16
- node.properties.rel = ['noopener', 'noreferrer'];
19
+ if (isExternalWebLink(node.properties.href, siteUrl)) {
20
+ node.properties['data-external-link'] = '';
21
+ if (externalNewTab) node.properties.target = '_blank';
22
+ }
23
+ if (typeof node.properties.target === 'string') {
24
+ const rel = node.properties.rel;
25
+ const safeRel = secureLinkRel(
26
+ node.properties.target,
27
+ Array.isArray(rel)
28
+ ? rel.join(' ')
29
+ : typeof rel === 'string'
30
+ ? rel
31
+ : undefined,
32
+ );
33
+ if (safeRel !== undefined)
34
+ node.properties.rel = safeRel.split(/\s+/);
35
+ }
17
36
  });
18
37
  };
19
38
  }
@@ -6,7 +6,21 @@ import type { SiteConfig } from './types.js';
6
6
 
7
7
  const linkSchema = z.object({
8
8
  label: z.string().trim().min(1),
9
- href: z.string().trim().min(1),
9
+ href: z
10
+ .string()
11
+ .trim()
12
+ .min(1)
13
+ .refine((href) => {
14
+ if (href.startsWith('//') || /[\u0000-\u0020\u007f\\]/.test(href))
15
+ return false;
16
+ try {
17
+ return ['http:', 'https:', 'mailto:', 'tel:'].includes(
18
+ new URL(href, 'https://example.invalid').protocol,
19
+ );
20
+ } catch {
21
+ return false;
22
+ }
23
+ }, 'must be a safe website, email or telephone link'),
10
24
  });
11
25
  const headerLinkSchema = linkSchema.extend({
12
26
  icon: z
@@ -23,6 +37,13 @@ const heroClass = z.string().regex(/^ss-[a-z0-9][a-z0-9_-]*$/, {
23
37
  });
24
38
 
25
39
  const siteSchema = z.object({
40
+ links: z
41
+ .object({
42
+ externalNewTab: z.boolean().optional(),
43
+ externalIcon: z.boolean().optional(),
44
+ })
45
+ .strict()
46
+ .optional(),
26
47
  name: z.string().trim().min(1),
27
48
  url: z.url(),
28
49
  base: z
@@ -80,6 +101,38 @@ const siteSchema = z.object({
80
101
  footer: z.object({
81
102
  text: z.string().trim().min(1),
82
103
  links: z.array(linkSchema),
104
+ groups: z
105
+ .array(
106
+ z
107
+ .object({
108
+ title: z.string().trim().min(1),
109
+ links: z.array(headerLinkSchema.strict()).min(1),
110
+ })
111
+ .strict(),
112
+ )
113
+ .optional(),
114
+ social: z
115
+ .object({
116
+ title: z.string().trim().min(1),
117
+ links: z
118
+ .array(
119
+ linkSchema
120
+ .extend({
121
+ platform: z.enum([
122
+ 'github',
123
+ 'instagram',
124
+ 'facebook',
125
+ ]),
126
+ })
127
+ .strict(),
128
+ )
129
+ .min(1),
130
+ })
131
+ .strict()
132
+ .optional(),
133
+ copyright: z.string().trim().min(1).optional(),
134
+ showVersion: z.boolean().optional(),
135
+ languageSwitcher: z.boolean().optional(),
83
136
  }),
84
137
  });
85
138
 
@@ -34,6 +34,10 @@ export interface SiteConfig {
34
34
  language: string;
35
35
  locales: string[];
36
36
  heroClasses: string[];
37
+ links?: {
38
+ externalNewTab?: boolean;
39
+ externalIcon?: boolean;
40
+ };
37
41
  blog?: {
38
42
  title: string;
39
43
  description: string;
@@ -41,5 +45,16 @@ export interface SiteConfig {
41
45
  heading: string;
42
46
  };
43
47
  header: { links: HeaderItem[] };
44
- footer: { text: string; links: Link[] };
48
+ footer: {
49
+ text: string;
50
+ links: Link[];
51
+ groups?: { title: string; links: (Link & { icon?: string })[] }[];
52
+ social?: {
53
+ title: string;
54
+ links: (Link & { platform: 'github' | 'instagram' | 'facebook' })[];
55
+ };
56
+ copyright?: string;
57
+ showVersion?: boolean;
58
+ languageSwitcher?: boolean;
59
+ };
45
60
  }
@@ -64,6 +64,37 @@ export function isExternalWebLink(href: string, siteUrl: string): boolean {
64
64
  );
65
65
  }
66
66
 
67
+ /** Preserve existing relationship tokens and secure any explicitly requested new tab. */
68
+ export function secureLinkRel(
69
+ target: string | undefined,
70
+ rel: string | undefined,
71
+ ): string | undefined {
72
+ if (target?.toLowerCase() !== '_blank') return rel;
73
+ const tokens = new Set(
74
+ (rel ?? '')
75
+ .split(/\s+/)
76
+ .filter(Boolean)
77
+ .map((token) => token.toLowerCase()),
78
+ );
79
+ tokens.add('noopener');
80
+ tokens.add('noreferrer');
81
+ return [...tokens].join(' ');
82
+ }
83
+
84
+ /** Attributes for native theme anchors; no client-side DOM rewriting. */
85
+ export function externalLinkAttributes(
86
+ href: string,
87
+ site: Pick<SiteConfig, 'url' | 'links'>,
88
+ ): { 'data-external-link'?: string; target?: '_blank'; rel?: string } {
89
+ if (!isExternalWebLink(href, site.url)) return {};
90
+ return {
91
+ 'data-external-link': '',
92
+ ...(site.links?.externalNewTab !== false
93
+ ? { target: '_blank' as const, rel: 'noopener noreferrer' }
94
+ : {}),
95
+ };
96
+ }
97
+
67
98
  export function canonicalUrl(route: string, site: SiteConfig): string {
68
99
  return new URL(contentHref(route, site), site.url).toString();
69
100
  }
@@ -91,6 +91,10 @@ const mdxComponentImport =
91
91
  /^import\s*\{\s*Column\s*,\s*Columns(?:\s*,\s*Eyebrow)?\s*\}\s*from\s*['"]sproutsite\/components['"];?$/;
92
92
  const eyebrowComponentImport =
93
93
  /^import\s*\{\s*Eyebrow\s*\}\s*from\s*['"]sproutsite\/components['"];?$/;
94
+ const legalIdentityImport =
95
+ /^import\s*\{\s*LegalIdentity\s*\}\s*from\s*['"]sproutsite\/components['"];?$/;
96
+ const privacyInfrastructureImport =
97
+ /^import\s*\{\s*PrivacyInfrastructure\s*\}\s*from\s*['"]sproutsite\/components['"];?$/;
94
98
  const alertComponentImport =
95
99
  /^import\s*\{\s*Alert\s*\}\s*from\s*['"]sproutsite\/components['"];?$/;
96
100
  const contentImageComponentImport =
@@ -184,6 +188,8 @@ function validateMdxLayout(
184
188
  let badgeCount = 0;
185
189
  let iconCount = 0;
186
190
  let featureCount = 0;
191
+ let legalIdentityCount = 0;
192
+ let privacyInfrastructureCount = 0;
187
193
  let accordionCount = 0;
188
194
  const validatedAccordionItems = new Set<MdxNode>();
189
195
  const localImageImports = new Set<string>();
@@ -207,6 +213,8 @@ function validateMdxLayout(
207
213
  if (
208
214
  !mdxComponentImport.test(importValue) &&
209
215
  !eyebrowComponentImport.test(importValue) &&
216
+ !legalIdentityImport.test(importValue) &&
217
+ !privacyInfrastructureImport.test(importValue) &&
210
218
  !alertComponentImport.test(importValue) &&
211
219
  !contentImageComponentImport.test(importValue) &&
212
220
  !cardComponentImport.test(importValue) &&
@@ -957,6 +965,52 @@ function validateMdxLayout(
957
965
  path,
958
966
  'Badge accepts optional variant, style (solid, outline, soft, dash), and size props',
959
967
  );
968
+ } else if (mdxNode.name === 'PrivacyInfrastructure') {
969
+ privacyInfrastructureCount += 1;
970
+ const attributes = mdxNode.attributes ?? [];
971
+ if (
972
+ attributes.some(
973
+ (attribute) =>
974
+ attribute.type !== 'mdxJsxAttribute' ||
975
+ attribute.name !== 'part' ||
976
+ ![
977
+ 'hosting',
978
+ 'email-retention',
979
+ 'log-size-limit',
980
+ 'log-retention',
981
+ ].includes(String(attribute.value)),
982
+ ) ||
983
+ attributes.length > 1 ||
984
+ (mdxNode.children?.length ?? 0) > 0
985
+ )
986
+ fail(
987
+ contentRoot,
988
+ path,
989
+ 'PrivacyInfrastructure only accepts optional part="hosting|email-retention|log-size-limit|log-retention" and no children',
990
+ );
991
+ } else if (mdxNode.name === 'LegalIdentity') {
992
+ legalIdentityCount += 1;
993
+ const attributes = mdxNode.attributes ?? [];
994
+ if (
995
+ attributes.some(
996
+ (attribute) =>
997
+ attribute.type !== 'mdxJsxAttribute' ||
998
+ attribute.name !== 'part' ||
999
+ ![
1000
+ 'contact',
1001
+ 'name',
1002
+ 'email',
1003
+ 'controller',
1004
+ ].includes(String(attribute.value)),
1005
+ ) ||
1006
+ attributes.length > 1 ||
1007
+ (mdxNode.children?.length ?? 0) > 0
1008
+ )
1009
+ fail(
1010
+ contentRoot,
1011
+ path,
1012
+ 'LegalIdentity only accepts optional part="contact|name|email|controller" and no children',
1013
+ );
960
1014
  } else if (mdxNode.name === 'Eyebrow') {
961
1015
  eyebrowCount += 1;
962
1016
  if (mdxNode.attributes?.length !== 0)
@@ -1145,6 +1199,8 @@ function validateMdxLayout(
1145
1199
  badgeCount === 0 &&
1146
1200
  iconCount === 0 &&
1147
1201
  featureCount === 0 &&
1202
+ legalIdentityCount === 0 &&
1203
+ privacyInfrastructureCount === 0 &&
1148
1204
  accordionCount === 0)
1149
1205
  )
1150
1206
  fail(
@@ -11,6 +11,8 @@ export { default as Badge } from '../themes/default/components/atoms/Badge/Badge
11
11
  export { default as Button } from '../themes/default/components/atoms/Button/Button.astro';
12
12
  export { default as Icon } from '../themes/default/components/atoms/Icon/Icon.astro';
13
13
  export { default as Feature } from '../themes/default/components/molecules/Feature/Feature.astro';
14
+ export { default as LegalIdentity } from '../themes/default/components/molecules/LegalIdentity/LegalIdentity.astro';
15
+ export { default as PrivacyInfrastructure } from '../themes/default/components/molecules/PrivacyInfrastructure/PrivacyInfrastructure.astro';
14
16
  export { default as Accordion } from '../themes/default/components/molecules/Accordion/Accordion.astro';
15
17
  export { default as AccordionItem } from '../themes/default/components/molecules/AccordionItem/AccordionItem.astro';
16
18
  export { default as Column } from '../themes/default/components/layout/Column/Column.astro';
@@ -153,7 +153,13 @@ export function createSproutsiteConfig() {
153
153
  rehypeHeadingIds,
154
154
  rehypeUniqueHeadingIds,
155
155
  rehypeContentTables,
156
- [rehypeExternalLinks, site.url],
156
+ [
157
+ rehypeExternalLinks,
158
+ {
159
+ url: site.url,
160
+ externalNewTab: site.links?.externalNewTab ?? true,
161
+ },
162
+ ],
157
163
  ],
158
164
  }),
159
165
  },
@@ -0,0 +1,2 @@
1
+ <!-- Lucide ArrowUpRight; ISC license, see third-party-licenses/lucide-LICENSE. -->
2
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M7 7h10v10"/><path d="M7 17 17 7"/></svg>
@@ -0,0 +1,38 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="1600" height="180" viewBox="0 0 1600 180" fill="none" aria-hidden="true">
2
+ <defs>
3
+ <linearGradient id="back-wave" x1="540" y1="170" x2="1600" y2="55" gradientUnits="userSpaceOnUse">
4
+ <stop stop-color="#0B294A" stop-opacity="0"/>
5
+ <stop offset="0.38" stop-color="#10476B" stop-opacity="0.50"/>
6
+ <stop offset="0.78" stop-color="#0B6075" stop-opacity="0.76"/>
7
+ <stop offset="1" stop-color="#087B78" stop-opacity="0.88"/>
8
+ </linearGradient>
9
+ <linearGradient id="crest-base" x1="960" y1="168" x2="1550" y2="20" gradientUnits="userSpaceOnUse">
10
+ <stop stop-color="#0D2B50" stop-opacity="0.10"/>
11
+ <stop offset="0.35" stop-color="#125B86" stop-opacity="0.62"/>
12
+ <stop offset="0.7" stop-color="#078481" stop-opacity="0.90"/>
13
+ <stop offset="1" stop-color="#159A70" stop-opacity="0.92"/>
14
+ </linearGradient>
15
+ <radialGradient id="crest-green" cx="0" cy="0" r="1" gradientTransform="translate(1510 62) rotate(163) scale(370 98)" gradientUnits="userSpaceOnUse">
16
+ <stop stop-color="#73DF48" stop-opacity="0.83"/>
17
+ <stop offset="0.24" stop-color="#40BF61" stop-opacity="0.65"/>
18
+ <stop offset="0.58" stop-color="#159C78" stop-opacity="0.22"/>
19
+ <stop offset="1" stop-color="#159C78" stop-opacity="0"/>
20
+ </radialGradient>
21
+ <linearGradient id="middle-wave" x1="660" y1="95" x2="1550" y2="177" gradientUnits="userSpaceOnUse">
22
+ <stop stop-color="#0D3458" stop-opacity="0.12"/>
23
+ <stop offset="0.48" stop-color="#15567B" stop-opacity="0.75"/>
24
+ <stop offset="1" stop-color="#0B365C" stop-opacity="0.84"/>
25
+ </linearGradient>
26
+ <linearGradient id="front-wave" x1="920" y1="125" x2="1570" y2="185" gradientUnits="userSpaceOnUse">
27
+ <stop stop-color="#0B2B4E" stop-opacity="0.18"/>
28
+ <stop offset="0.5" stop-color="#10446C" stop-opacity="0.75"/>
29
+ <stop offset="1" stop-color="#092947" stop-opacity="0.88"/>
30
+ </linearGradient>
31
+ <path id="crest-shape" d="M 810 210 C 990 185 1135 132 1250 100 C 1380 64 1470 35 1600 30 L 1600 210 Z"/>
32
+ </defs>
33
+ <path d="M 0 167 C 245 174 410 160 615 143 C 805 125 950 129 1090 105 C 1300 70 1460 80 1600 45 L 1600 180 L 0 180 Z" fill="url(#back-wave)"/>
34
+ <use href="#crest-shape" fill="url(#crest-base)"/>
35
+ <use href="#crest-shape" fill="url(#crest-green)"/>
36
+ <path d="M 350 190 C 560 170 720 142 880 142 C 1050 142 1155 170 1300 142 C 1425 118 1515 115 1600 123 L 1600 190 Z" fill="url(#middle-wave)"/>
37
+ <path d="M 720 190 C 940 173 1070 157 1210 164 C 1365 174 1495 144 1600 151 L 1600 190 Z" fill="url(#front-wave)"/>
38
+ </svg>
@@ -1,5 +1,9 @@
1
1
  ---
2
- import { contentHref } from '../../../../../lib/sproutsite/urls.js';
2
+ import {
3
+ contentHref,
4
+ externalLinkAttributes,
5
+ secureLinkRel,
6
+ } from '../../../../../lib/sproutsite/urls.js';
3
7
  import { loadSiteConfig } from '../../../../../lib/sproutsite/site-config.js';
4
8
  import type { HTMLAttributes } from 'astro/types';
5
9
 
@@ -50,6 +54,14 @@ const {
50
54
  disabled = false,
51
55
  } = Astro.props;
52
56
  const site = loadSiteConfig(Astro.currentLocale === 'de' ? 'de' : 'en');
57
+ const externalAttributes: ReturnType<typeof externalLinkAttributes> = href
58
+ ? externalLinkAttributes(href, site)
59
+ : {};
60
+ const linkTarget = target ?? externalAttributes.target;
61
+ const linkRel = secureLinkRel(
62
+ linkTarget,
63
+ [rel, externalAttributes.rel].filter(Boolean).join(' ') || undefined,
64
+ );
53
65
 
54
66
  if (href && disabled)
55
67
  throw new Error('Sproutsite Button links cannot be disabled.');
@@ -92,8 +104,9 @@ const classes = [
92
104
  <a
93
105
  class:list={classes}
94
106
  href={contentHref(href, site)}
95
- target={target}
96
- rel={rel}
107
+ {...externalAttributes}
108
+ target={linkTarget}
109
+ rel={linkRel}
97
110
  aria-current={ariaCurrent}
98
111
  >
99
112
  {/* @slot Button label or other inline content. */}
@@ -13,6 +13,10 @@
13
13
  .ss-card__body {
14
14
  @apply flex flex-1 flex-col;
15
15
 
16
+ a:not(.ss-button) {
17
+ @apply font-semibold;
18
+ }
19
+
16
20
  > h3:first-child {
17
21
  @apply card-title;
18
22
  }