feat: Shows events as cards on the home page
Replaces the line of links to previous events with cards after the 40C3 start page: each card has the event's logo (designs.events.ccc.de) in its heading bar, the motto, full name, dates and venue. 40C3 is greyed out as in progress; the other cards link to their tours. The events shortcode reads data/events.yaml; the README documents it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
97cb34b576
commit
bbaff0ee91
1 changed files with 396 additions and 2 deletions
25
README.md
25
README.md
|
|
@ -216,6 +216,31 @@ In the GeoJSON, `coordinates` are already in `[lon, lat]` order, the colour and
|
|||
|
||||
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/*/<event>/`), 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, shown below the cards, for logos whose licence asks for it.
|
||||
|
||||
The heading shows the event's logo, `assets/img/events/<event>.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):
|
||||
|
|
|
|||
Loading…
Reference in a new issue