maverick-wave-astro 1.25.0 → 1.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -14
- package/components/ImprintCard.astro +88 -26
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,15 +22,21 @@ export default defineConfig({
|
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
The integration sets the CSP-safe build options, the `@` alias, the sitemap,
|
|
25
|
-
`/design.css`, `/theme.js` and the MaverickWave script
|
|
26
|
-
`satisfies Site` (`src/types.ts`). Colours
|
|
27
|
-
`main.scss`.
|
|
25
|
+
`/design.css`, `/theme.js` and the MaverickWave script, without its localhost
|
|
26
|
+
indicator. `site.ts` is typed with `satisfies Site` (`src/types.ts`). Colours
|
|
27
|
+
and fonts stay in the site's `main.scss`.
|
|
28
|
+
|
|
29
|
+
The build decides what applies today - promotion, events, closures, today's
|
|
30
|
+
occasion - and the HTML holds nothing else. Every site is meant to be built
|
|
31
|
+
again each night; the werkbank does so at 03:30.
|
|
28
32
|
|
|
29
33
|
After the build it writes `robots.txt` (`site.aiCrawlers`), `llms.txt` and, with
|
|
30
34
|
`site.email`, `/.well-known/security.txt` - only for a site at the root of its
|
|
31
|
-
host, a file in `public/` wins. It
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
host, a file in `public/` wins. It minifies every `.js` in `dist`, files from
|
|
36
|
+
`public/` included, and drops every comment. It stops on a birth date in a
|
|
37
|
+
`data-*` attribute or `birthDate` in the JSON-LD, and warns about titles over 60
|
|
38
|
+
characters, descriptions outside 140-160, pages without exactly one `<h1>` and
|
|
39
|
+
images over 200 KB.
|
|
34
40
|
|
|
35
41
|
## Design
|
|
36
42
|
|
|
@@ -54,9 +60,12 @@ The site wraps `BaseLayout` once and imports its stylesheet there:
|
|
|
54
60
|
</Frame>
|
|
55
61
|
```
|
|
56
62
|
|
|
57
|
-
Slot `banner` sits below the header
|
|
58
|
-
`
|
|
59
|
-
|
|
63
|
+
Slot `banner` sits below the header. `promo` puts `mwa-promo-active` and
|
|
64
|
+
`data-promo-until` on `<html>` when the promotion runs on the day of the build;
|
|
65
|
+
`htmlData` puts other `data-*` there. Canonical, `og:url`, sitemap and
|
|
66
|
+
`llms.txt` name every page without a trailing slash. `bodyClass` adds to
|
|
67
|
+
`site.bodyClass`; `bare` renders only the default slot into `<body>` - no skip
|
|
68
|
+
link, no `<main>`, no header or footer.
|
|
60
69
|
|
|
61
70
|
`AppShell` is the frame of an app page: render it inside `BaseLayout bare`, it
|
|
62
71
|
brings its own skip link. `nav` groups `AppLink`s, `tabbar` takes the phone's
|
|
@@ -79,8 +88,8 @@ The toggles come from the MaverickWave script.
|
|
|
79
88
|
indeterminate, `Timeline` `variant="compact"`, `Picture` `shape` (arch |
|
|
80
89
|
signature | leaf), `Table` `hover` and `stickyFirst`
|
|
81
90
|
- Pages: `NotFound`, `LegalPage`, `ImprintCard`, `PrivacyCard`
|
|
82
|
-
- `Schedule`
|
|
83
|
-
|
|
91
|
+
- `Schedule` takes `mwa-promo-active` away once `data-promo-until` has passed -
|
|
92
|
+
the one check left for the browser, should the nightly build fail
|
|
84
93
|
|
|
85
94
|
Helpers live in `src/` and import as `maverick-wave-astro/<file>`.
|
|
86
95
|
|
|
@@ -116,9 +125,8 @@ site-wide.
|
|
|
116
125
|
Seasonal decoration on the cards, panels and testimonials - snow, a garland,
|
|
117
126
|
leaves, bunting. Drawn by MaverickWave (`components/occasions`), switched on by
|
|
118
127
|
a file: with `src/content/occasions.json`, or a werkbank section with an
|
|
119
|
-
`occasions.schema.json`, the integration
|
|
120
|
-
|
|
121
|
-
`<head>`. It picks today's entry before the first paint.
|
|
128
|
+
`occasions.schema.json`, the integration picks today's entry while building and
|
|
129
|
+
puts its classes on `<html>`. The other entries never reach the HTML.
|
|
122
130
|
|
|
123
131
|
```json
|
|
124
132
|
{
|
|
@@ -1,52 +1,114 @@
|
|
|
1
1
|
---
|
|
2
2
|
// Imprint from imprint.json as a card - the way the product sites show it.
|
|
3
|
-
// The site brings the page frame and heading itself.
|
|
3
|
+
// The site brings the page frame and heading itself. The headings come from
|
|
4
|
+
// here so every site reads the same; a topic left empty is left out.
|
|
5
|
+
import { config } from '../dist/config.js';
|
|
4
6
|
import PostalAddress from './PostalAddress.astro';
|
|
5
7
|
|
|
6
8
|
interface Props {
|
|
7
9
|
imprint: {
|
|
8
|
-
subtitle: string;
|
|
9
10
|
address: { company?: string; name: string; street: string; city: string };
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
addressNotes?: { noVisitors?: boolean; noParcels?: boolean };
|
|
12
|
+
// What the trade adds: profession, chamber, permit, register, representation
|
|
13
|
+
sections?: readonly { title: string; lines: readonly string[] }[];
|
|
14
|
+
vat?: string;
|
|
15
|
+
responsible?: string;
|
|
16
|
+
dispute: string;
|
|
17
|
+
credits?: readonly string[];
|
|
17
18
|
};
|
|
18
19
|
mail: { href: string; text: string };
|
|
20
|
+
phone?: { href: string; text: string };
|
|
19
21
|
class?: string;
|
|
20
22
|
}
|
|
21
23
|
|
|
22
|
-
const
|
|
24
|
+
const text = config.site.lang.startsWith('de')
|
|
25
|
+
? {
|
|
26
|
+
address: 'Angaben gemäß § 5 DDG',
|
|
27
|
+
contact: 'Kontakt',
|
|
28
|
+
phone: 'Telefon',
|
|
29
|
+
mail: 'E-Mail',
|
|
30
|
+
vat: 'Umsatzsteuer',
|
|
31
|
+
responsible: 'Verantwortlich für den Inhalt nach § 18 Abs. 2 MStV',
|
|
32
|
+
dispute: 'Verbraucherstreitbeilegung',
|
|
33
|
+
credits: 'Lizenzen und Nachweise',
|
|
34
|
+
noVisitors:
|
|
35
|
+
'Kein Publikumsverkehr - Besuche nur nach Terminvereinbarung.',
|
|
36
|
+
noParcels: 'Keine Annahme von Paketen und Warensendungen.',
|
|
37
|
+
}
|
|
38
|
+
: {
|
|
39
|
+
address: 'Information according to Section 5 DDG',
|
|
40
|
+
contact: 'Contact',
|
|
41
|
+
phone: 'Phone',
|
|
42
|
+
mail: 'Email',
|
|
43
|
+
vat: 'VAT',
|
|
44
|
+
responsible: 'Responsible for content according to Section 18(2) MStV',
|
|
45
|
+
dispute: 'Consumer dispute resolution',
|
|
46
|
+
credits: 'Licenses and credits',
|
|
47
|
+
noVisitors: 'No walk-in visitors - visits by appointment only.',
|
|
48
|
+
noParcels: 'Parcels and goods deliveries are not accepted.',
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const { imprint, mail, phone, class: className } = Astro.props;
|
|
52
|
+
|
|
53
|
+
// Letters are never excluded here - a note against mail would let the address
|
|
54
|
+
// count as not serviceable (§ 5 DDG).
|
|
55
|
+
const notes = (['noVisitors', 'noParcels'] as const)
|
|
56
|
+
.filter(key => imprint.addressNotes?.[key])
|
|
57
|
+
.map(key => text[key]);
|
|
58
|
+
|
|
59
|
+
const sections = [
|
|
60
|
+
...(imprint.sections ?? []),
|
|
61
|
+
{ title: text.vat, lines: [imprint.vat] },
|
|
62
|
+
{ title: text.responsible, lines: [imprint.responsible] },
|
|
63
|
+
{ title: text.dispute, lines: [imprint.dispute] },
|
|
64
|
+
{ title: text.credits, lines: imprint.credits ?? [] },
|
|
65
|
+
]
|
|
66
|
+
.map(section => ({ ...section, lines: section.lines.filter(Boolean) }))
|
|
67
|
+
.filter(section => section.lines.length > 0);
|
|
23
68
|
---
|
|
24
69
|
|
|
25
70
|
<div class:list={['mw-card mw-card-simple mw-prose', className]}>
|
|
26
|
-
<h2>{
|
|
71
|
+
<h2>{text.address}</h2>
|
|
27
72
|
<PostalAddress address={imprint.address} />
|
|
28
|
-
|
|
29
|
-
<h2>{imprint.contactTitle}</h2>
|
|
30
|
-
<p><a href={mail.href}>{mail.text}</a></p>
|
|
31
|
-
|
|
32
73
|
{
|
|
33
|
-
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
74
|
+
notes.length > 0 && (
|
|
75
|
+
<p class="mw-text-sm mw-text-muted">
|
|
76
|
+
{notes.map((note, index) => (
|
|
77
|
+
<Fragment>
|
|
78
|
+
{index > 0 && <br />}
|
|
79
|
+
{note}
|
|
80
|
+
</Fragment>
|
|
81
|
+
))}
|
|
82
|
+
</p>
|
|
38
83
|
)
|
|
39
84
|
}
|
|
40
85
|
|
|
41
|
-
<h2>{
|
|
42
|
-
<p>
|
|
86
|
+
<h2>{text.contact}</h2>
|
|
87
|
+
<p>
|
|
88
|
+
{
|
|
89
|
+
phone && (
|
|
90
|
+
<Fragment>
|
|
91
|
+
{text.phone}: <a href={phone.href}>{phone.text}</a>
|
|
92
|
+
<br />
|
|
93
|
+
</Fragment>
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
{text.mail}: <a href={mail.href}>{mail.text}</a>
|
|
97
|
+
</p>
|
|
43
98
|
|
|
44
99
|
{
|
|
45
|
-
|
|
100
|
+
sections.map(section => (
|
|
46
101
|
<Fragment>
|
|
47
|
-
<h2>{
|
|
48
|
-
<p>
|
|
102
|
+
<h2>{section.title}</h2>
|
|
103
|
+
<p>
|
|
104
|
+
{section.lines.map((line, index) => (
|
|
105
|
+
<Fragment>
|
|
106
|
+
{index > 0 && <br />}
|
|
107
|
+
{line}
|
|
108
|
+
</Fragment>
|
|
109
|
+
))}
|
|
110
|
+
</p>
|
|
49
111
|
</Fragment>
|
|
50
|
-
)
|
|
112
|
+
))
|
|
51
113
|
}
|
|
52
114
|
</div>
|
package/package.json
CHANGED