diff --git a/README.md b/README.md index b836837..e80f7e9 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,31 @@ Without a data file, or without any tours in it, the shortcode renders nothing a Hugo crops the thumbnails to squares (keeping the most interesting part of the picture) at build time; the lightbox shows the original file. Without JavaScript, a thumbnail links to the original file. A missing image, a missing `alt` or a `gallery-image` outside a `gallery` stops the build with an error that names the page. +## Shortcode: Event cards + +The home page (`content/*/_index.md`) lists the events as cards with `{{< events >}}`, modelled on the cards of the [40C3 start page](https://events.ccc.de/congress/2026/infos/startpage.html). It reads `data/events.yaml`, which is shared by both languages, and shows the events in the order of the file, newest first: + +```yaml +events: + - event: 39c3 + title: { de: 39. Chaos Communication Congress, en: 39th Chaos Communication Congress } + motto: Power Cycles + start: "2025-12-27" + end: "2025-12-30" + venue: CCH +``` + +- `event` is the name of the event's section (`content/*//`), which the card links to. The card's heading shows it in capitals (`39C3`); `name` (optional) replaces that. +- `title` is the event's full name, with one entry per language, or one for both: `title: Easterhegg 2025`. +- `motto` and `venue` are shown as they are. +- `start` and `end` are `YYYY-MM-DD`. The card shows the range in the page's language, as on the 40C3 start page: `27.–30. Dezember 2025`, `27–30 December 2025`. Leave out `end` for a one-day event. +- `status` (optional): `inprogress` greys the card out, without a link, and marks it "In Vorbereitung" / "In progress", for an event whose tours aren't online yet. Remove it once the event's section exists. +- `credit` (optional) names the logo's authors and licence in Markdown, for logos whose licence asks for it. It is shown in the footer of the pages with the cards. + +The heading shows the event's logo, `assets/img/events/.svg`, in the text colour. The SVG's own colours are ignored, only its shape counts, so use a version without a background. Where each logo comes from, and its licence, is listed in [assets/img/events/Sources.txt](assets/img/events/Sources.txt). + +An event without a section, that isn't in progress either, gets a greyed-out card without a link, and the build logs a warning, as it does for a missing logo. Without a data file, or without any events in it, the shortcode renders nothing and the build logs a warning; to silence it, add `warning-events-empty` to `ignoreLogs` in `hugo.yaml`. + ## Accessibility check CI runs [pa11y-ci](https://github.com/pa11y/pa11y-ci) with the axe and HTML_CodeSniffer rules for WCAG 2 AA on every push and pull request, in its own job (`accessibility`), so findings show up without blocking the deploy. To run the same check locally (needs Node.js, Python 3 and Chrome or Chromium): diff --git a/assets/css/_custom.css b/assets/css/_custom.css index fbd0ff6..05b4462 100644 --- a/assets/css/_custom.css +++ b/assets/css/_custom.css @@ -1,13 +1,14 @@ @import './_schedule.css'; @import './_gallery.css'; +@import './_events.css'; /* - * 40C3 "MODEL_CITIZENS" design, after the 40C3 styleguide. + * 40C3 "MODEL_CITIZENS" design, after the 40C3 styleguide and the 40C3 startpage + * (events.ccc.de/congress/2026/infos/startpage.html). * Key colours: green (0), paper (A) and ink (B); the other colours are accents. * Dark: ink background, paper text, green accents. - * Light: paper background and ink text, as on the 40C3 info pages - * (events.ccc.de/congress/2026/infos). Those pages also put black boxes behind links and give - * each heading level its own colour; this site doesn't, it sticks to the styleguide's chips. + * Light: paper background and ink text. + * Paper is the startpage's light green (#dff0d4), not the styleguide's grey (#ebedf0). * WCAG AA contrast: on ink every palette colour works as text, but on the light background * only the foreground does. So in the light scheme green is only ever a fill or a line, * with foreground-coloured text on it. @@ -21,7 +22,7 @@ --c40-coral: #ea6f82; --c40-orange: #f88a30; --c40-amber: #ffbc40; - --c40-paper: #ebedf0; + --c40-paper: #dff0d4; --c40-ink: #001300; --c40-light-bg: var(--c40-paper); @@ -128,28 +129,36 @@ mark { color: var(--c40-on-fill); } -/* Headings: Jersey 10 for the big ones. h1 is the "loud header" (filled chip), h3 and below - are Hack Bold, h3 underlined like the styleguide's subheads. */ +/* Headings: Jersey 10 for the big ones, as on the 40C3 startpage. Page titles (h1) are capitals + in the foreground colour (green in the dark scheme), section headings (h2) capitals on a green + box. Post titles in lists and the schedule's days are plain h2s, the size of the card titles. + h3 and below are Hack Bold, h3 underlined like the styleguide's subheads. */ h1, h2 { + color: light-dark(var(--c40-light-fg), var(--c40-green)); font-family: var(--ff-display); - font-weight: 400; + /* Jersey 10 has a single weight; like the startpage, this has browsers draw it bolder. */ + font-weight: bold; letter-spacing: 0; - line-height: 1; + line-height: normal; } h1 { - width: fit-content; - max-width: 100%; - padding: 0.12em 0.3em 0.2em; - background: var(--c40-green); - color: var(--c40-on-fill); - font-size: calc(var(--fs-xxl) * var(--display-scale)); + font-size: min(3rem, calc(var(--fs-xxl) * var(--display-scale))); + text-transform: uppercase; } h2 { - color: light-dark(var(--c40-light-fg), var(--c40-green)); - font-size: calc(var(--fs-xl) * var(--display-scale)); + font-size: calc(var(--fs-l) * var(--display-scale)); +} + +h2:not(.title, .schedule__day-title) { + width: fit-content; + padding-inline: 1rem; + background: var(--c40-green); + color: var(--c40-on-fill); + font-size: min(2.4rem, calc(var(--fs-xl) * var(--display-scale))); + text-transform: uppercase; } h3 { @@ -173,7 +182,7 @@ h3 { white-space: pre-line; } -/* Branding: the logo, and the site name as a loud header chip like the page's own h1. */ +/* Branding: the logo, and the site name set like the page titles. */ .header { color: var(--color-text); } @@ -206,11 +215,17 @@ h3 { } } +/* The name takes the heading's colour; on hover and focus it gets the links' green chip, with + dark text, because green text would vanish on it. */ .header__site-link { - color: inherit; + &:link, + &:visited { + color: inherit; + } &:hover, &:focus-visible { + color: var(--c40-on-fill); text-decoration: underline; } } diff --git a/assets/css/_events.css b/assets/css/_events.css new file mode 100644 index 0000000..5cbdf69 --- /dev/null +++ b/assets/css/_events.css @@ -0,0 +1,144 @@ +/* + * Event cards on the home page (events shortcode), after the cards on the 40C3 start page + * (events.ccc.de/congress/2026/infos/startpage.html): a frame with a heading bar that holds the + * event's logo, drawn in the text colour like the start page's icons. Cards of past events link to + * their tours and fill the heading bar on hover and focus; an event in progress is greyed out. + */ + +.event-cards { + --event-card-line: 0.125rem; + + /* The start page's neutrals for inactive cards; text contrast about 5.5:1 (light) and 6.5:1 (dark). */ + --event-card-inactive-bg: light-dark(#c9dabf, #162915); + --event-card-inactive-line: light-dark(#b2c4aa, #2d3f2a); + --event-card-inactive-text: light-dark(#435540, #9cae94); + + display: grid; + grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr)); + gap: 2rem; + margin-block: 0 var(--spacing-m); + padding: 0; + list-style: none; +} + +.event-cards__item { + max-width: none; +} + +.event-card { + display: flex; + flex-direction: column; + block-size: 100%; + border: var(--event-card-line) solid var(--c40-green); + background: var(--color-body-bg); + color: var(--color-text); + text-decoration: none; +} + +.event-card__heading { + display: flex; + align-items: center; + justify-content: space-between; + gap: 1rem; + padding: 0.5rem 1rem; + border-block-end: var(--event-card-line) solid var(--c40-green); + color: light-dark(var(--c40-light-fg), var(--c40-green)); +} + +.event-card__title { + max-width: none; + margin: 0; + color: inherit; + font-family: var(--ff-display); + font-size: calc(var(--fs-l) * var(--display-scale)); + font-weight: bold; + line-height: 1; + text-decoration: none; +} + +/* The logo as a mask in the text colour, 2rem high (the start page's size-8 icons); wide + wordmarks shrink to leave room for the title. */ +.event-card__logo { + flex: none; + max-inline-size: 60%; + block-size: 2rem; + background-color: currentcolor; + mask: var(--event-logo) right center / contain no-repeat; +} + +.event-card__body { + display: flex; + flex-direction: column; + flex-grow: 1; + gap: 0.25rem; + padding: 0.5rem 1rem 0.75rem; + + p { + margin: 0; + } +} + +.event-card__motto { + font-weight: bold; +} + +.event-card__meta { + color: var(--color-text-meta); + font-size: var(--fs-s); +} + +.event-card__status { + align-self: flex-start; + margin-block-start: 0.25rem; + padding: 0.1rem 0.5rem; + border: var(--event-card-line) solid currentcolor; + font-size: var(--fs-xs); + font-weight: bold; + letter-spacing: 0.03em; + text-transform: uppercase; +} + +.event-card--inactive { + border-color: var(--event-card-inactive-line); + background: var(--event-card-inactive-bg); + color: var(--event-card-inactive-text); + + .event-card__heading { + border-color: var(--event-card-inactive-line); + color: inherit; + } + + .event-card__meta { + color: inherit; + } +} + +/* Hover and focus: the heading bar is filled, ink in the light scheme and green in the dark one, + and the text below is underlined like a link. */ +a.event-card:hover, +a.event-card:focus-visible { + border-color: light-dark(var(--c40-ink), var(--c40-green)); + background: var(--color-body-bg); + + .event-card__heading { + border-color: light-dark(var(--c40-ink), var(--c40-green)); + background: light-dark(var(--c40-ink), var(--c40-green)); + color: light-dark(var(--c40-green), var(--c40-ink)); + } + + .event-card__body { + text-decoration: underline; + } +} + +/* Forced colours drop background colours, and with them the masked logos. */ +@media (forced-colors: active) { + .event-card__logo { + background-color: CanvasText; + forced-color-adjust: none; + } + + a.event-card .event-card__logo { + background-color: LinkText; + } +} diff --git a/assets/img/events/37c3.svg b/assets/img/events/37c3.svg new file mode 100644 index 0000000..926f429 --- /dev/null +++ b/assets/img/events/37c3.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/img/events/38c3.svg b/assets/img/events/38c3.svg new file mode 100644 index 0000000..505dbeb --- /dev/null +++ b/assets/img/events/38c3.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/events/39c3.svg b/assets/img/events/39c3.svg new file mode 100644 index 0000000..19fddb9 --- /dev/null +++ b/assets/img/events/39c3.svg @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/assets/img/events/40c3.svg b/assets/img/events/40c3.svg new file mode 100644 index 0000000..9146ede --- /dev/null +++ b/assets/img/events/40c3.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/img/events/Sources.txt b/assets/img/events/Sources.txt new file mode 100644 index 0000000..bf3fbb7 --- /dev/null +++ b/assets/img/events/Sources.txt @@ -0,0 +1,18 @@ +Event logos for the event cards on the home page (events shortcode, data/events.yaml). +The cards use them as masks in the text colour, so the colours in the files don't matter. +All files are unmodified copies of the originals. + +37c3.svg https://designs.events.ccc.de/37C3/37c3-logo-full-black.svg +38c3.svg https://designs.events.ccc.de/38C3/logo-simple.svg +39c3.svg https://designs.events.ccc.de/39C3/39C3-Logo-RGB_muted-black.svg + From the CCC event design archive, https://designs.events.ccc.de/ + +40c3.svg https://events.ccc.de/congress/2026/infos/assets/favicon.svg + The 40C3 symbol from the 40C3 info pages; the design archive has no 40C3 entry yet. + +eh22.svg logo/logo_simple.svg from the Easterhegg 2025 design repository, + https://git.hamburg.ccc.de/EH22/design-public + By kritzl, traumweh & Schrottkatze, licensed under CC BY-SA 4.0, + https://creativecommons.org/licenses/by-sa/4.0/ + The home page credits it below the cards (credit in data/events.yaml). + The design archive's EH22 logo is a raster image with a glow, which doesn't work as a mask. diff --git a/assets/img/events/eh22.svg b/assets/img/events/eh22.svg new file mode 100644 index 0000000..0ab3f5d --- /dev/null +++ b/assets/img/events/eh22.svg @@ -0,0 +1,34 @@ + + + + + + + + + + diff --git a/content/de/37c3/electrum/index.md b/content/de/37c3/electrum/index.md index 089b023..a5ded77 100644 --- a/content/de/37c3/electrum/index.md +++ b/content/de/37c3/electrum/index.md @@ -10,7 +10,7 @@ Das electrum ist Hamburgs Museum der Elektrizität und Technik. Ohne Strom geht {{< gallery-image src="Electrum_Hamburg-Harburg.nnw.jpg" alt="Museum electrum in Hamburg-Harburg, cc-by-sa NordNordWest" >}} {{< /gallery >}} -# Daten +## Daten * Tag 1 (27.12) **12:30 Uhr** * Dauer: 1,5h * Spache: Deutsch diff --git a/content/de/38c3/electrum/index.md b/content/de/38c3/electrum/index.md index 7e59539..3d1dcd9 100644 --- a/content/de/38c3/electrum/index.md +++ b/content/de/38c3/electrum/index.md @@ -18,7 +18,7 @@ Lizenz: (https://creativecommons.org/licenses/by-sa/3.0/de/legalcode) Das Museum wird von einem Verein geführt und unterstützt. Ihr seid herzlich dazu eingeladen, den Verein ebenfalls, entweder aktiv oder passiv, zu unterstützen, z. B. in [Form einer Vereinsmitgliedschaft](https://www.electrum-hamburg.de/content/download/71/298?version=2). -# Daten +## Daten * ~~Tag 3 (29.12.) **13:45 Uhr** Deutsch~~ ausgebucht * ~~Tag 3 (29.12.) **14:45 Uhr** Englisch~~ ausgebucht * Dauer: 1 Stunde diff --git a/content/de/_index.md b/content/de/_index.md index 378f538..db2bf63 100644 --- a/content/de/_index.md +++ b/content/de/_index.md @@ -14,12 +14,10 @@ cascade: intro: Wir von Hamburg Hackertours zeigen euch die Stadt! --- -# 40C3 - -Wir bereiten Touren für den [40C3](https://events.ccc.de/category/40c3/) vor. In Kürze mehr! - ![Hamburger Hacker Ausflüge am CCC. CC0 Amzi](hackertours_banner.webp) -Frühere Veranstaltungen: [37C3](37c3) / [38C3](38c3) / [EH22](eh22) / [39C3](39c3) +## Veranstaltungen + +{{< events >}} ## News diff --git a/content/en/_index.md b/content/en/_index.md index 407411f..2a5ead6 100644 --- a/content/en/_index.md +++ b/content/en/_index.md @@ -14,13 +14,11 @@ cascade: intro: We at Hamburg Hackertours show you around the city! --- -# 40C3 - -We are preparing tours for [40C3](https://events.ccc.de/category/40c3/). Stay tuned! - ![Hamburger Hacker Ausflüge am CCC. CC0 Amzi](hackertours_banner.webp) -Previous events: [37C3](37c3) / [38C3](38c3) / [EH22](eh22) / [39C3](39c3) +## Events + +{{< events >}} ## News \ No newline at end of file diff --git a/data/events.yaml b/data/events.yaml new file mode 100644 index 0000000..949e184 --- /dev/null +++ b/data/events.yaml @@ -0,0 +1,37 @@ +# Event cards on the home page, rendered by the events shortcode, newest first. +# event: the event's section (content/*//) and logo (assets/img/events/.svg). +# status: inprogress greys out the card and leaves out the link, for an event without tours yet. +# credit: the logo's authors and licence in Markdown, shown in the footer of pages with the cards. +events: + - event: 40c3 + title: { de: 40. Chaos Communication Congress, en: 40th Chaos Communication Congress } + motto: Model Citizens + start: "2026-12-27" + end: "2026-12-30" + venue: Hamburg Messe + status: inprogress + - event: 39c3 + title: { de: 39. Chaos Communication Congress, en: 39th Chaos Communication Congress } + motto: Power Cycles + start: "2025-12-27" + end: "2025-12-30" + venue: CCH + - event: eh22 + title: Easterhegg 2025 + motto: Unhandled Eggception + start: "2025-04-18" + end: "2025-04-21" + venue: Kampnagel + credit: "[kritzl, traumweh & Schrottkatze](https://git.hamburg.ccc.de/EH22/design-public), [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)" + - event: 38c3 + title: { de: 38. Chaos Communication Congress, en: 38th Chaos Communication Congress } + motto: Illegal Instructions + start: "2024-12-27" + end: "2024-12-30" + venue: CCH + - event: 37c3 + title: { de: 37. Chaos Communication Congress, en: 37th Chaos Communication Congress } + motto: Unlocked + start: "2023-12-27" + end: "2023-12-30" + venue: CCH diff --git a/i18n/de.yaml b/i18n/de.yaml index 0a49b28..2dc6216 100644 --- a/i18n/de.yaml +++ b/i18n/de.yaml @@ -9,3 +9,8 @@ gallery_dialog: "Bildansicht" gallery_close: "Schließen" gallery_previous: "Vorheriges Bild" gallery_next: "Nächstes Bild" +events_inprogress: "In Vorbereitung" +events_logo: "Logo {{ .Name }}" +events_date: "2. January 2006" +events_date_day_month: "2. January" +events_date_day: "2." diff --git a/i18n/en.yaml b/i18n/en.yaml index 8929d38..0dc05ec 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -9,3 +9,8 @@ gallery_dialog: "Image viewer" gallery_close: "Close" gallery_previous: "Previous image" gallery_next: "Next image" +events_inprogress: "In progress" +events_logo: "{{ .Name }} logo" +events_date: "2 January 2006" +events_date_day_month: "2 January" +events_date_day: "2" diff --git a/layouts/_partials/footer.html b/layouts/_partials/footer.html index e39f339..0e63352 100644 --- a/layouts/_partials/footer.html +++ b/layouts/_partials/footer.html @@ -1,6 +1,14 @@ -{{- /* Overrides the zen theme's footer.html. Same as the theme's, plus the 40C3 logo. */ -}} +{{- /* Overrides the zen theme's footer.html. Same as the theme's, plus the 40C3 logo and, on pages +with event cards, the credits for event logos whose licence asks for one (credit in data/events.yaml). */ -}} {{ if $.Param "feedlinks" }}{{ partial "feedlinks.html" . }}{{ end -}}

{{ with site.Copyright }}{{ . | site.Home.RenderString }}{{ else }}© {{ site.Title }}{{ end }}

+{{- if .HasShortcode "events" }} +{{- $credits := slice }} +{{- with hugo.Data.events }}{{ range .events }}{{ if .credit }}{{ $credits = $credits | append (dict "name" (.name | default (upper .event)) "credit" .credit) }}{{ end }}{{ end }}{{ end }} +{{- with $credits }} +

{{ range $index, $entry := . }}{{ if $index }} · {{ end }}{{ i18n "events_logo" (dict "Name" $entry.name) }}: {{ $entry.credit | site.Home.RenderString }}{{ end }}

+{{- end }} +{{- end }} {{ with $.Param "footer" }}

{{ . | site.Home.RenderString }}

{{ end }} {{ if $.Param "poweredby" }}

Powered by Hugo and the Zen theme.

{{ end }} diff --git a/layouts/_partials/head/extra.html b/layouts/_partials/head/extra.html index 957c2d7..94a21b7 100644 --- a/layouts/_partials/head/extra.html +++ b/layouts/_partials/head/extra.html @@ -1,6 +1,6 @@ {{ partial "head/fonts.html" . }} {{- /* Browser UI colours, the same as the page backgrounds in assets/css/_custom.css. */ -}} - + {{- /* Open Graph image for link previews. The theme's head/meta.html writes og:image only for the diff --git a/layouts/_shortcodes/events.html b/layouts/_shortcodes/events.html new file mode 100644 index 0000000..b8de3a8 --- /dev/null +++ b/layouts/_shortcodes/events.html @@ -0,0 +1,75 @@ +{{- /* +Event cards from data/events.yaml, after the cards on the 40C3 start page +(events.ccc.de/congress/2026/infos/startpage.html): the event's name and logo +(assets/img/events/.svg) in a heading bar, its motto, full name, dates and venue below. +Cards link to the event's section; an event that is in progress, or has no section, gets a +greyed-out card without a link. Logo credits from the data file are in the footer (footer.html). + +Usage: {{< events >}} +*/ -}} +{{- $events := slice -}} +{{- with hugo.Data.events }}{{ with .events }}{{ $events = . }}{{ end }}{{ end -}} +{{- if not $events -}} + {{- warnidf "warning-events-empty" "events: no events in data/events.yaml: %s" .Position -}} +{{- else -}} +
    +{{- range $events }} +{{- $name := .name | default (upper .event) }} +{{- $inProgress := eq .status "inprogress" }} +{{- $page := site.GetPage (printf "/%s" .event) }} +{{- if not (or $page $inProgress) }}{{ warnf "events: no section page for event %q" .event }}{{ end }} +{{- $link := and $page (not $inProgress) }} +{{- /* A title with one entry per language, or one for all. */}} +{{- $title := .title }} +{{- if reflect.IsMap $title }}{{ $title = index $title site.Language.Name | default (index $title "en") }}{{ end }} +{{- /* Date ranges as on the 40C3 start page: "27.–30. Dezember 2026", "27–30 December 2026". */}} +{{- $start := time.AsTime .start }} +{{- $end := time.AsTime (.end | default .start) }} +{{- $date := i18n "events_date" }} +{{- $when := $end | time.Format $date }} +{{- if ne $start.Year $end.Year }} + {{- $when = printf "%s – %s" ($start | time.Format $date) $when }} +{{- else if ne $start.Month $end.Month }} + {{- $when = printf "%s – %s" ($start | time.Format (i18n "events_date_day_month")) $when }} +{{- else if ne $start.Day $end.Day }} + {{- $when = printf "%s–%s" ($start | time.Format (i18n "events_date_day")) $when }} +{{- end }} +{{- /* The logo keeps its proportions (the SVG's viewBox) at the height set in CSS. */}} +{{- $logo := resources.Get (printf "img/events/%s.svg" .event) }} +{{- $ratio := slice 1 1 }} +{{- with $logo }} + {{- with findRESubmatch `viewBox="\s*[-\d.]+[\s,]+[-\d.]+[\s,]+([\d.]+)[\s,]+([\d.]+)\s*"` .Content 1 }} + {{- $ratio = slice (float (index . 0 1)) (float (index . 0 2)) }} + {{- end }} +{{- else }} + {{- warnf "events: no logo assets/img/events/%s.svg" .event }} +{{- end }} +
  • +{{- if $link }} + +{{- else }} +{{ end }} +
  • +{{- end }} +
+{{- end }} diff --git a/static/site.webmanifest b/static/site.webmanifest index 485596a..4214259 100644 --- a/static/site.webmanifest +++ b/static/site.webmanifest @@ -15,7 +15,7 @@ "purpose": "maskable" } ], - "theme_color": "#ebedf0", - "background_color": "#ebedf0", + "theme_color": "#dff0d4", + "background_color": "#dff0d4", "display": "standalone" } \ No newline at end of file