sproutsite 0.5.14 → 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.
- package/README.md +21 -1
- package/THIRD_PARTY_NOTICES.md +2 -0
- package/VERSION +1 -1
- package/package.json +2 -1
- package/src/lib/sproutsite/legal-identity.ts +85 -0
- package/src/lib/sproutsite/privacy-infrastructure.ts +70 -0
- package/src/lib/sproutsite/rehype-links.ts +24 -5
- package/src/lib/sproutsite/site-config.ts +7 -0
- package/src/lib/sproutsite/types.ts +4 -0
- package/src/lib/sproutsite/urls.ts +31 -0
- package/src/lib/sproutsite/validation.ts +56 -0
- package/src/package/components.ts +2 -0
- package/src/package/config.ts +7 -1
- package/src/themes/default/assets/arrow-up-right.svg +2 -0
- package/src/themes/default/components/atoms/Button/Button.astro +16 -3
- package/src/themes/default/components/molecules/Card/Card.css +4 -0
- package/src/themes/default/components/molecules/Feature/Feature.css +4 -0
- package/src/themes/default/components/molecules/LanguageSwitcher/LanguageSwitcher.css +3 -0
- package/src/themes/default/components/molecules/LegalIdentity/LegalIdentity.astro +92 -0
- package/src/themes/default/components/molecules/LegalIdentity/LegalIdentity.css +22 -0
- package/src/themes/default/components/molecules/PrivacyInfrastructure/PrivacyInfrastructure.astro +89 -0
- package/src/themes/default/components/molecules/PrivacyInfrastructure/PrivacyInfrastructure.css +16 -0
- package/src/themes/default/components/organisms/Footer/Footer.astro +2 -12
- package/src/themes/default/components/organisms/Footer/Footer.css +15 -4
- package/src/themes/default/components/organisms/Header/Header.astro +8 -12
- package/src/themes/default/components/organisms/Header/Header.css +4 -4
- package/src/themes/default/layouts/PageLayout/PageLayout.astro +6 -1
- package/src/themes/default/styles/foundation/base.css +5 -0
- package/src/themes/default/styles/foundation/links.css +28 -0
- package/src/themes/default/styles/foundation/prose.css +6 -1
- package/src/themes/default/styles/theme.css +3 -0
package/README.md
CHANGED
|
@@ -446,7 +446,9 @@ Omit `label` beside explanatory text: the icon is then decorative (`aria-hidden`
|
|
|
446
446
|
|
|
447
447
|
## Structure and Theme
|
|
448
448
|
|
|
449
|
-
|
|
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.
|
|
450
452
|
|
|
451
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.
|
|
452
454
|
|
|
@@ -596,6 +598,24 @@ Storybook is a local developer tool and not part of the published website. It re
|
|
|
596
598
|
|
|
597
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.
|
|
598
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
|
+
|
|
599
619
|
### Logo and icons
|
|
600
620
|
|
|
601
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.
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -25,6 +25,8 @@ Language-selector flags are local SVG assets from `flag-icons` 7.6.0, licensed u
|
|
|
25
25
|
|
|
26
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.
|
|
27
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
|
+
|
|
28
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.
|
|
29
31
|
|
|
30
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.
|
|
1
|
+
0.5.15
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sproutsite",
|
|
3
|
-
"version": "0.5.
|
|
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.",
|
|
@@ -94,6 +94,7 @@
|
|
|
94
94
|
"astro": "^7.4.12",
|
|
95
95
|
"axe-core": "^4.13.0",
|
|
96
96
|
"fontkit": "^2.0.4",
|
|
97
|
+
"hast-util-from-html": "^2.1.0",
|
|
97
98
|
"playwright": "^1.63.0",
|
|
98
99
|
"prettier": "^3.9.10",
|
|
99
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(
|
|
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 (
|
|
15
|
-
|
|
16
|
-
|
|
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
|
}
|
|
@@ -37,6 +37,13 @@ const heroClass = z.string().regex(/^ss-[a-z0-9][a-z0-9_-]*$/, {
|
|
|
37
37
|
});
|
|
38
38
|
|
|
39
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(),
|
|
40
47
|
name: z.string().trim().min(1),
|
|
41
48
|
url: z.url(),
|
|
42
49
|
base: z
|
|
@@ -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';
|
package/src/package/config.ts
CHANGED
|
@@ -153,7 +153,13 @@ export function createSproutsiteConfig() {
|
|
|
153
153
|
rehypeHeadingIds,
|
|
154
154
|
rehypeUniqueHeadingIds,
|
|
155
155
|
rehypeContentTables,
|
|
156
|
-
[
|
|
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>
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
import {
|
|
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
|
-
|
|
96
|
-
|
|
107
|
+
{...externalAttributes}
|
|
108
|
+
target={linkTarget}
|
|
109
|
+
rel={linkRel}
|
|
97
110
|
aria-current={ariaCurrent}
|
|
98
111
|
>
|
|
99
112
|
{/* @slot Button label or other inline content. */}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { loadLegalIdentity } from '../../../../../lib/sproutsite/legal-identity.js';
|
|
3
|
+
import { loadSiteConfig } from '../../../../../lib/sproutsite/site-config.js';
|
|
4
|
+
import { externalLinkAttributes } from '../../../../../lib/sproutsite/urls.js';
|
|
5
|
+
import Column from '../../layout/Column/Column.astro';
|
|
6
|
+
import Columns from '../../layout/Columns/Columns.astro';
|
|
7
|
+
import Feature from '../Feature/Feature.astro';
|
|
8
|
+
import Alert from '../Alert/Alert.astro';
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
part?: 'contact' | 'name' | 'email' | 'controller';
|
|
12
|
+
}
|
|
13
|
+
const { part = 'contact' } = Astro.props;
|
|
14
|
+
if (!['contact', 'name', 'email', 'controller'].includes(part))
|
|
15
|
+
throw new Error(
|
|
16
|
+
'LegalIdentity part must be contact, name, email or controller.',
|
|
17
|
+
);
|
|
18
|
+
const { values, placeholder } = loadLegalIdentity(import.meta.env.PROD);
|
|
19
|
+
const german = Astro.currentLocale === 'de';
|
|
20
|
+
const site = loadSiteConfig(german ? 'de' : 'en');
|
|
21
|
+
const country =
|
|
22
|
+
new Intl.DisplayNames([german ? 'de' : 'en'], { type: 'region' }).of(
|
|
23
|
+
values.LEGAL_COUNTRY,
|
|
24
|
+
) ?? values.LEGAL_COUNTRY;
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
{part === 'name' ? (
|
|
28
|
+
values.LEGAL_NAME
|
|
29
|
+
) : part === 'email' ? (
|
|
30
|
+
<a href={`mailto:${values.LEGAL_EMAIL}`}>{values.LEGAL_EMAIL}</a>
|
|
31
|
+
) : (
|
|
32
|
+
<div class="ss-legal-identity">
|
|
33
|
+
{placeholder && (
|
|
34
|
+
<Alert variant="info">
|
|
35
|
+
{german
|
|
36
|
+
? 'Vorschau mit Beispieldaten: Die Betreiberangaben in der lokalen .env fehlen, sind unvollständig oder enthalten noch Musterwerte.'
|
|
37
|
+
: 'Preview with example data: Operator details in the local .env are missing, incomplete or still contain example values.'}
|
|
38
|
+
</Alert>
|
|
39
|
+
)}
|
|
40
|
+
<Columns>
|
|
41
|
+
<Column span={6}>
|
|
42
|
+
<Feature
|
|
43
|
+
icon="MapPin"
|
|
44
|
+
title={german ? 'Postanschrift' : 'Postal address'}
|
|
45
|
+
layout="card"
|
|
46
|
+
color="primary"
|
|
47
|
+
>
|
|
48
|
+
<address>
|
|
49
|
+
<strong>{values.LEGAL_NAME}</strong>
|
|
50
|
+
<span>{values.LEGAL_STREET}</span>
|
|
51
|
+
<span>
|
|
52
|
+
{values.LEGAL_POSTAL_CODE} {values.LEGAL_CITY}
|
|
53
|
+
</span>
|
|
54
|
+
<span>{country}</span>
|
|
55
|
+
</address>
|
|
56
|
+
</Feature>
|
|
57
|
+
</Column>
|
|
58
|
+
<Column span={6}>
|
|
59
|
+
<Feature
|
|
60
|
+
icon="Mail"
|
|
61
|
+
title={german ? 'Kontakt' : 'Contact'}
|
|
62
|
+
layout="card"
|
|
63
|
+
color="secondary"
|
|
64
|
+
>
|
|
65
|
+
<p>
|
|
66
|
+
<strong>{german ? 'E-Mail' : 'Email'}</strong>
|
|
67
|
+
<br />
|
|
68
|
+
<a href={`mailto:${values.LEGAL_EMAIL}`}>
|
|
69
|
+
{values.LEGAL_EMAIL}
|
|
70
|
+
</a>
|
|
71
|
+
</p>
|
|
72
|
+
{part !== 'controller' && (
|
|
73
|
+
<p>
|
|
74
|
+
<strong>LinkedIn</strong>
|
|
75
|
+
<br />
|
|
76
|
+
<a
|
|
77
|
+
href={values.LEGAL_LINKEDIN}
|
|
78
|
+
{...externalLinkAttributes(
|
|
79
|
+
values.LEGAL_LINKEDIN,
|
|
80
|
+
site,
|
|
81
|
+
)}
|
|
82
|
+
>
|
|
83
|
+
{values.LEGAL_NAME}{' '}
|
|
84
|
+
{german ? 'auf LinkedIn' : 'on LinkedIn'}
|
|
85
|
+
</a>
|
|
86
|
+
</p>
|
|
87
|
+
)}
|
|
88
|
+
</Feature>
|
|
89
|
+
</Column>
|
|
90
|
+
</Columns>
|
|
91
|
+
</div>
|
|
92
|
+
)}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.ss-legal-identity {
|
|
3
|
+
address {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
font-style: normal;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
a {
|
|
10
|
+
color: var(--color-primary);
|
|
11
|
+
text-decoration: none;
|
|
12
|
+
text-underline-offset: 0.2em;
|
|
13
|
+
&:hover {
|
|
14
|
+
text-decoration: underline;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
p {
|
|
19
|
+
margin-block: 0 0.75rem;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
package/src/themes/default/components/molecules/PrivacyInfrastructure/PrivacyInfrastructure.astro
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { loadPrivacyInfrastructure } from '../../../../../lib/sproutsite/privacy-infrastructure.js';
|
|
3
|
+
import { loadSiteConfig } from '../../../../../lib/sproutsite/site-config.js';
|
|
4
|
+
import { externalLinkAttributes } from '../../../../../lib/sproutsite/urls.js';
|
|
5
|
+
import Feature from '../Feature/Feature.astro';
|
|
6
|
+
import Alert from '../Alert/Alert.astro';
|
|
7
|
+
interface Props {
|
|
8
|
+
part?: 'hosting' | 'email-retention' | 'log-size-limit' | 'log-retention';
|
|
9
|
+
}
|
|
10
|
+
const { part = 'hosting' } = Astro.props;
|
|
11
|
+
if (
|
|
12
|
+
!['hosting', 'email-retention', 'log-size-limit', 'log-retention'].includes(
|
|
13
|
+
part,
|
|
14
|
+
)
|
|
15
|
+
)
|
|
16
|
+
throw new Error('Invalid PrivacyInfrastructure part.');
|
|
17
|
+
const { values, placeholder } = loadPrivacyInfrastructure(import.meta.env.PROD);
|
|
18
|
+
const german = Astro.currentLocale === 'de';
|
|
19
|
+
const site = loadSiteConfig(german ? 'de' : 'en');
|
|
20
|
+
const country =
|
|
21
|
+
new Intl.DisplayNames([german ? 'de' : 'en'], { type: 'region' }).of(
|
|
22
|
+
values.PRIVACY_SERVER_COUNTRY,
|
|
23
|
+
) ?? values.PRIVACY_SERVER_COUNTRY;
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
{part === 'email-retention' ? (
|
|
27
|
+
values.PRIVACY_EMAIL_RETENTION_MONTHS
|
|
28
|
+
) : part === 'log-size-limit' ? (
|
|
29
|
+
<>{values.PRIVACY_LOG_SIZE_LIMIT_MIB} MiB</>
|
|
30
|
+
) : part === 'log-retention' ? (
|
|
31
|
+
values.PRIVACY_LOG_RETENTION_DAYS ? (
|
|
32
|
+
<p>
|
|
33
|
+
{german
|
|
34
|
+
? `Die beschriebenen nginx- und Traefik-Protokolle werden im regulären Betrieb spätestens nach ${values.PRIVACY_LOG_RETENTION_DAYS} Tagen gelöscht.`
|
|
35
|
+
: `During normal operation, the nginx and Traefik logs described above are deleted within ${values.PRIVACY_LOG_RETENTION_DAYS} days.`}
|
|
36
|
+
</p>
|
|
37
|
+
) : (
|
|
38
|
+
<Alert variant="warning">
|
|
39
|
+
{german
|
|
40
|
+
? 'Noch offen: Eine feste Speicherfrist in Tagen für die eingerichteten nginx-Zugriffs-/Fehlerprotokolle und Traefik-Betriebs-/Fehlerprotokolle ist nicht hinterlegt. Die Größenbegrenzung allein garantiert keine maximale Aufbewahrungsdauer in Tagen.'
|
|
41
|
+
: 'Still open: No fixed retention period in days has been specified for the configured nginx access/error logs and Traefik operational/error logs. A size limit alone does not guarantee a maximum retention period in days.'}
|
|
42
|
+
</Alert>
|
|
43
|
+
)
|
|
44
|
+
) : (
|
|
45
|
+
<div class="ss-privacy-infrastructure">
|
|
46
|
+
{placeholder && (
|
|
47
|
+
<Alert variant="info">
|
|
48
|
+
{german
|
|
49
|
+
? 'Vorschau mit Beispieldaten: Hostingangaben in .env ergänzen.'
|
|
50
|
+
: 'Preview with example data: Complete the hosting details in .env.'}
|
|
51
|
+
</Alert>
|
|
52
|
+
)}
|
|
53
|
+
<Feature
|
|
54
|
+
icon="Server"
|
|
55
|
+
title={german ? 'Hosting-Infrastruktur' : 'Hosting infrastructure'}
|
|
56
|
+
layout="card"
|
|
57
|
+
color="primary"
|
|
58
|
+
>
|
|
59
|
+
<p>
|
|
60
|
+
<a
|
|
61
|
+
href={values.PRIVACY_HOST_URL}
|
|
62
|
+
{...externalLinkAttributes(values.PRIVACY_HOST_URL, site)}
|
|
63
|
+
>
|
|
64
|
+
{values.PRIVACY_HOST_NAME}
|
|
65
|
+
</a>
|
|
66
|
+
</p>
|
|
67
|
+
<address>{values.PRIVACY_HOST_ADDRESS}</address>
|
|
68
|
+
<p>
|
|
69
|
+
<strong>
|
|
70
|
+
{german ? 'Serverstandort:' : 'Server location:'}
|
|
71
|
+
</strong>{' '}
|
|
72
|
+
{values.PRIVACY_SERVER_CITY}, {country}
|
|
73
|
+
</p>
|
|
74
|
+
<p>
|
|
75
|
+
<a
|
|
76
|
+
href={values.PRIVACY_HOST_PRIVACY_URL}
|
|
77
|
+
{...externalLinkAttributes(
|
|
78
|
+
values.PRIVACY_HOST_PRIVACY_URL,
|
|
79
|
+
site,
|
|
80
|
+
)}
|
|
81
|
+
>
|
|
82
|
+
{german
|
|
83
|
+
? 'Datenschutzhinweise des Hosting-Anbieters'
|
|
84
|
+
: 'Hosting provider privacy information'}
|
|
85
|
+
</a>
|
|
86
|
+
</p>
|
|
87
|
+
</Feature>
|
|
88
|
+
</div>
|
|
89
|
+
)}
|
package/src/themes/default/components/molecules/PrivacyInfrastructure/PrivacyInfrastructure.css
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.ss-privacy-infrastructure {
|
|
3
|
+
address {
|
|
4
|
+
font-style: normal;
|
|
5
|
+
margin-bottom: 0.75rem;
|
|
6
|
+
}
|
|
7
|
+
a {
|
|
8
|
+
color: var(--color-primary);
|
|
9
|
+
text-decoration: none;
|
|
10
|
+
text-underline-offset: 0.2em;
|
|
11
|
+
&:hover {
|
|
12
|
+
text-decoration: underline;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -9,7 +9,7 @@ import { t } from '../../../i18n/index.js';
|
|
|
9
9
|
import type { SiteConfig } from '../../../../../lib/sproutsite/types.js';
|
|
10
10
|
import {
|
|
11
11
|
contentHref,
|
|
12
|
-
|
|
12
|
+
externalLinkAttributes,
|
|
13
13
|
} from '../../../../../lib/sproutsite/urls.js';
|
|
14
14
|
interface Props {
|
|
15
15
|
site: SiteConfig;
|
|
@@ -24,8 +24,7 @@ const socialIcons = {
|
|
|
24
24
|
};
|
|
25
25
|
const linkAttributes = (href: string) => ({
|
|
26
26
|
href: contentHref(href, site),
|
|
27
|
-
|
|
28
|
-
rel: isExternalWebLink(href, site.url) ? 'noopener noreferrer' : undefined,
|
|
27
|
+
...externalLinkAttributes(href, site),
|
|
29
28
|
});
|
|
30
29
|
---
|
|
31
30
|
|
|
@@ -62,15 +61,6 @@ const linkAttributes = (href: string) => ({
|
|
|
62
61
|
</span>
|
|
63
62
|
)}
|
|
64
63
|
<span>{link.label}</span>
|
|
65
|
-
{isExternalWebLink(link.href, site.url) && (
|
|
66
|
-
<span class="ss-footer__external">
|
|
67
|
-
<Icon
|
|
68
|
-
name="ArrowUpRight"
|
|
69
|
-
size={16}
|
|
70
|
-
strokeWidth={1.5}
|
|
71
|
-
/>
|
|
72
|
-
</span>
|
|
73
|
-
)}
|
|
74
64
|
<span class="ss-footer__chevron">
|
|
75
65
|
<Icon
|
|
76
66
|
name="ChevronRight"
|
|
@@ -62,10 +62,13 @@
|
|
|
62
62
|
> a {
|
|
63
63
|
display: inline-block;
|
|
64
64
|
text-decoration: none;
|
|
65
|
+
&:hover {
|
|
66
|
+
text-decoration: underline;
|
|
67
|
+
}
|
|
65
68
|
}
|
|
66
69
|
.ss-brand-logo {
|
|
67
70
|
font-size: 2rem;
|
|
68
|
-
gap: 0.
|
|
71
|
+
gap: 0.25rem;
|
|
69
72
|
img {
|
|
70
73
|
width: 3rem;
|
|
71
74
|
height: 3rem;
|
|
@@ -92,13 +95,20 @@
|
|
|
92
95
|
padding-block: 0.375rem;
|
|
93
96
|
}
|
|
94
97
|
.ss-footer__link-icon,
|
|
95
|
-
.ss-footer__external,
|
|
96
98
|
.ss-footer__chevron {
|
|
97
99
|
display: inline-flex;
|
|
98
100
|
flex: none;
|
|
99
101
|
}
|
|
100
102
|
.ss-footer__chevron {
|
|
101
103
|
margin-inline-start: auto;
|
|
104
|
+
order: 1;
|
|
105
|
+
}
|
|
106
|
+
.ss-footer__link-icon {
|
|
107
|
+
margin-inline-end: 0.5rem;
|
|
108
|
+
}
|
|
109
|
+
a::after {
|
|
110
|
+
/* Offset the flex gap to match inline link arrows. */
|
|
111
|
+
margin-inline-start: calc(0.2em - 0.75rem);
|
|
102
112
|
}
|
|
103
113
|
}
|
|
104
114
|
.ss-footer__social {
|
|
@@ -111,8 +121,9 @@
|
|
|
111
121
|
gap: 1rem;
|
|
112
122
|
}
|
|
113
123
|
a {
|
|
114
|
-
display:
|
|
115
|
-
|
|
124
|
+
display: flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
justify-content: center;
|
|
116
127
|
width: 2.875rem;
|
|
117
128
|
height: 2.875rem;
|
|
118
129
|
border-radius: 0.625rem;
|
|
@@ -8,7 +8,7 @@ import { t } from '../../../i18n/index.js';
|
|
|
8
8
|
import type { Link, SiteConfig } from '../../../../../lib/sproutsite/types.js';
|
|
9
9
|
import {
|
|
10
10
|
contentHref,
|
|
11
|
-
|
|
11
|
+
externalLinkAttributes,
|
|
12
12
|
} from '../../../../../lib/sproutsite/urls.js';
|
|
13
13
|
|
|
14
14
|
interface Props {
|
|
@@ -72,7 +72,10 @@ const hasLanguageSwitcher = site.header.links.some(
|
|
|
72
72
|
/>
|
|
73
73
|
);
|
|
74
74
|
}
|
|
75
|
-
const
|
|
75
|
+
const externalAttributes = externalLinkAttributes(
|
|
76
|
+
link.href,
|
|
77
|
+
site,
|
|
78
|
+
);
|
|
76
79
|
// Icon validates configured names against Lucide at render time.
|
|
77
80
|
const icon = link.icon as
|
|
78
81
|
ComponentProps<typeof Icon>['name'] | undefined;
|
|
@@ -83,12 +86,8 @@ const hasLanguageSwitcher = site.header.links.some(
|
|
|
83
86
|
href={link.href}
|
|
84
87
|
variant={link.variant}
|
|
85
88
|
size="md"
|
|
86
|
-
target={
|
|
87
|
-
rel={
|
|
88
|
-
external
|
|
89
|
-
? 'noopener noreferrer'
|
|
90
|
-
: undefined
|
|
91
|
-
}
|
|
89
|
+
target={externalAttributes.target}
|
|
90
|
+
rel={externalAttributes.rel}
|
|
92
91
|
aria-current={
|
|
93
92
|
isActive(link) ? 'page' : undefined
|
|
94
93
|
}
|
|
@@ -104,10 +103,7 @@ const hasLanguageSwitcher = site.header.links.some(
|
|
|
104
103
|
<a
|
|
105
104
|
class="ss-header__link btn btn-ghost btn-sm"
|
|
106
105
|
href={contentHref(link.href, site)}
|
|
107
|
-
|
|
108
|
-
rel={
|
|
109
|
-
external ? 'noopener noreferrer' : undefined
|
|
110
|
-
}
|
|
106
|
+
{...externalAttributes}
|
|
111
107
|
aria-current={
|
|
112
108
|
isActive(link) ? 'page' : undefined
|
|
113
109
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
@apply flex flex-wrap items-center justify-between gap-x-8 gap-y-3 py-[2.1875rem] transition-[padding] duration-200;
|
|
15
15
|
|
|
16
16
|
.ss-header__brand {
|
|
17
|
-
@apply inline-flex items-center gap-3 text-lg font-bold text-primary-content no-underline hover:
|
|
17
|
+
@apply inline-flex items-center gap-3 text-lg font-bold text-primary-content no-underline hover:underline;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.ss-header__link,
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
|
|
36
36
|
.ss-header__cta {
|
|
37
37
|
.ss-button {
|
|
38
|
-
@apply m-0 !text-lg no-underline hover:
|
|
38
|
+
@apply m-0 !text-lg no-underline hover:underline;
|
|
39
39
|
|
|
40
40
|
&[aria-current='page'] {
|
|
41
41
|
@apply outline-2 outline-offset-2;
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.ss-header__link {
|
|
48
|
-
@apply relative !gap-2.5 !text-lg !text-primary-content no-underline hover:
|
|
48
|
+
@apply relative !gap-2.5 !text-lg !text-primary-content no-underline hover:underline;
|
|
49
49
|
border-color: transparent !important;
|
|
50
50
|
box-shadow: none !important;
|
|
51
51
|
|
|
@@ -200,7 +200,7 @@
|
|
|
200
200
|
border: 0;
|
|
201
201
|
border-radius: 0;
|
|
202
202
|
font-size: 1.5rem !important;
|
|
203
|
-
font-weight:
|
|
203
|
+
font-weight: 600 !important;
|
|
204
204
|
line-height: 1.35;
|
|
205
205
|
text-align: start;
|
|
206
206
|
white-space: normal;
|
|
@@ -95,7 +95,12 @@ const socialImage = new URL(socialCard.src, site.url).href;
|
|
|
95
95
|
<meta name="twitter:title" content={documentTitle} />
|
|
96
96
|
<meta name="twitter:description" content={description} />
|
|
97
97
|
</head>
|
|
98
|
-
<body
|
|
98
|
+
<body
|
|
99
|
+
class:list={{
|
|
100
|
+
'ss-page--landing': layout === 'landing',
|
|
101
|
+
'ss-links--external-icons': site.links?.externalIcon === true,
|
|
102
|
+
}}
|
|
103
|
+
>
|
|
99
104
|
<a class="ss-skip-link" href="#main-content">
|
|
100
105
|
{t(site.language === 'de' ? 'de' : 'en', 'skipToContent')}
|
|
101
106
|
</a>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
a {
|
|
3
|
+
text-decoration: none;
|
|
4
|
+
|
|
5
|
+
&:hover {
|
|
6
|
+
text-decoration: underline;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.ss-links--external-icons
|
|
10
|
+
&:is(
|
|
11
|
+
[data-external-link],
|
|
12
|
+
[target='_blank'],
|
|
13
|
+
[href^='mailto:' i],
|
|
14
|
+
[href^='tel:' i]
|
|
15
|
+
)::after {
|
|
16
|
+
content: '';
|
|
17
|
+
display: inline-block;
|
|
18
|
+
flex: none;
|
|
19
|
+
width: 0.85em;
|
|
20
|
+
height: 0.85em;
|
|
21
|
+
margin-inline-start: 0.2em;
|
|
22
|
+
vertical-align: -0.05em;
|
|
23
|
+
background-color: currentColor;
|
|
24
|
+
mask: url('../../assets/arrow-up-right.svg') center / contain
|
|
25
|
+
no-repeat;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
/* Markdown typography rendered by Astro Content Collections. */
|
|
2
2
|
@layer components {
|
|
3
3
|
.content-prose {
|
|
4
|
-
@apply prose max-w-none prose-headings:scroll-mt-8 prose-a:text-primary prose-a:font-
|
|
4
|
+
@apply prose max-w-none prose-headings:scroll-mt-8 prose-a:text-primary prose-a:font-semibold prose-a:decoration-2;
|
|
5
5
|
|
|
6
6
|
a {
|
|
7
7
|
@apply no-underline hover:underline;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
b,
|
|
11
|
+
strong {
|
|
12
|
+
font-weight: 600;
|
|
13
|
+
}
|
|
14
|
+
|
|
10
15
|
h1 {
|
|
11
16
|
font-size: var(--text-heading-1);
|
|
12
17
|
@apply mb-5 font-bold;
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
@import './foundation/fonts.css';
|
|
16
16
|
@import './foundation/tokens.css';
|
|
17
17
|
@import './foundation/base.css';
|
|
18
|
+
@import './foundation/links.css';
|
|
18
19
|
@import './foundation/prose.css';
|
|
19
20
|
@import './foundation/focus.css';
|
|
20
21
|
@import './foundation/layout.css';
|
|
@@ -37,6 +38,8 @@
|
|
|
37
38
|
@import '../components/molecules/ContentTable/ContentTable.css';
|
|
38
39
|
@import '../components/molecules/Card/Card.css';
|
|
39
40
|
@import '../components/molecules/Feature/Feature.css';
|
|
41
|
+
@import '../components/molecules/LegalIdentity/LegalIdentity.css';
|
|
42
|
+
@import '../components/molecules/PrivacyInfrastructure/PrivacyInfrastructure.css';
|
|
40
43
|
@import '../components/molecules/Accordion/Accordion.css';
|
|
41
44
|
@import '../components/molecules/AccordionItem/AccordionItem.css';
|
|
42
45
|
@import '../components/molecules/CardActions/CardActions.css';
|