maverick-wave-astro 1.29.0 → 1.30.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.
@@ -28,9 +28,11 @@ type Props = {
28
28
  // The page brings its own body: no skip link, no <main>, no header or
29
29
  // footer slot - a presentation is one.
30
30
  bare?: boolean;
31
+ // false keeps the occasion of the day off, e.g. on a TV or a menu sheet.
32
+ occasion?: boolean;
31
33
  };
32
34
 
33
- const { site, ogImage: OG_IMAGE, htmlClasses, designCss, occasion } = config;
35
+ const { site, ogImage: OG_IMAGE, htmlClasses, designCss } = config;
34
36
 
35
37
  const {
36
38
  title,
@@ -48,8 +50,11 @@ const {
48
50
  htmlData = {},
49
51
  bodyClass,
50
52
  bare = false,
53
+ occasion: withOccasion = true,
51
54
  } = Astro.props;
52
55
 
56
+ const occasion = withOccasion ? config.occasion : null;
57
+
53
58
  const canonicalUrl = new URL(
54
59
  withoutTrailingSlash(Astro.url.pathname),
55
60
  Astro.site
@@ -21,7 +21,7 @@ import {
21
21
  upcomingEvents,
22
22
  } from '../dist/schedule.js';
23
23
  import type { LookOptions, StoryIcon } from '../dist/story/base.js';
24
- import { blockLines, type StoryShare } from '../dist/story/caption.js';
24
+ import { blockLines, placeOf, type StoryShare } from '../dist/story/caption.js';
25
25
  import {
26
26
  eventBlocks,
27
27
  eventCard,
@@ -51,8 +51,8 @@ interface Props extends StoryLook {
51
51
  series?: readonly StorySeries[];
52
52
  // Path data from the site's own icon set, so the story matches the page.
53
53
  icons?: Partial<Record<StoryIcon, string>>;
54
- // The town for the texts to share, e.g. from the imprint - the section
55
- // Stories may name another one.
54
+ // The town for the texts to share, e.g. the city of the imprint with its
55
+ // postcode - the section Stories may name another one.
56
56
  place?: string;
57
57
  texts?: {
58
58
  share?: string;
@@ -134,7 +134,7 @@ const {
134
134
  } = texts;
135
135
 
136
136
  const site = config.site.name;
137
- const sharePlace = storyLook?.config.place?.trim() || place?.trim() || '';
137
+ const sharePlace = placeOf(storyLook?.config.place) || placeOf(place);
138
138
 
139
139
  interface Story {
140
140
  card: StoryCard;
@@ -22,6 +22,7 @@ export interface ShareSettings {
22
22
  place?: string;
23
23
  hashtags?: string;
24
24
  }
25
+ export declare const placeOf: (text: string | undefined) => string;
25
26
  export declare const shareLine: (block: RenderedBlock, label?: boolean) => ShareLine;
26
27
  export declare const blockLines: (blocks: readonly RenderedBlock[]) => ShareLine[];
27
28
  export declare const hashtagsOf: ({ place, hashtags }: ShareSettings) => string[];
@@ -4,6 +4,8 @@
4
4
  // the place and its local hashtags. Worked out in the browser on the page
5
5
  // /stories/ - "heute" is the day the owner shares it, not the day of the build.
6
6
  import { capitalized, dayPhrase, dayWords, parseIsoDate, } from "../date.js";
7
+ // The town as the imprint has it, "73240 Wendlingen" - a postcode is no hashtag.
8
+ export const placeOf = (text) => (text ?? '').trim().replace(/^\d{5}\s+/, '');
7
9
  export const shareLine = (block, label = false) => ({
8
10
  style: block.style,
9
11
  text: block.text,
@@ -288,7 +288,8 @@ export const seriesCards = (series, site, locale = 'de-DE', now = new Date()) =>
288
288
  blocks.find(block => block.text)?.text ??
289
289
  name;
290
290
  const date = dateOf(item);
291
- const lines = rendered.flatMap(({ source, block }) => block
291
+ // The head names a coming day already, a past one is no news.
292
+ const lines = rendered.flatMap(({ source, block }) => block && source !== dateField
292
293
  ? [
293
294
  shareLine(block, source === FIXED_TEXT && HEADINGS.includes(block.style)),
294
295
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maverick-wave-astro",
3
- "version": "1.29.0",
3
+ "version": "1.30.0",
4
4
  "description": "Shared frame for static Astro homepages built with MaverickWave: layout, SEO, design variants, schedule, building blocks.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -172,6 +172,18 @@
172
172
  white-space: nowrap;
173
173
  }
174
174
 
175
+ /* Beside a long title, time and place squeeze it into breaking mid-word. */
176
+ .mwa-signage-slide-events .mwa-signage-item {
177
+ grid-template-columns: minmax(0, 1fr);
178
+ }
179
+
180
+ .mwa-signage-slide-events .mwa-signage-value {
181
+ font-size: 3.2vmin;
182
+ font-weight: 400;
183
+ white-space: normal;
184
+ color: var(--mwa-signage-muted);
185
+ }
186
+
175
187
  /* A closure is why someone looks at the hours at all. */
176
188
  .mwa-signage-slide-hours .mwa-signage-text {
177
189
  font-weight: 700;