feat: Applies 40c3 style to website
Some checks failed
/ build (pull_request) Has been cancelled
/ accessibility (pull_request) Has been cancelled

This commit is contained in:
Vincent Mahnke 2026-11-07 10:34:09 +01:00
commit d3fc831bc5
Signed by: ViMaSter
GPG key ID: 6D787326BA7D6469
9 changed files with 701 additions and 161 deletions

View file

@ -0,0 +1,6 @@
{{- /* Overrides the zen theme's footer.html. Same as the theme's, plus the 40C3 logo. */ -}}
{{ if $.Param "feedlinks" }}{{ partial "feedlinks.html" . }}{{ end -}}
<p class="footer__event">{{ partial "logo-40c3.html" (dict "class" "footer__logo") }}</p>
<p>{{ with site.Copyright }}{{ . | site.Home.RenderString }}{{ else }}<span>© {{ site.Title }}</span>{{ end }}</p>
{{ with $.Param "footer" }}<p>{{ . | site.Home.RenderString }}</p>{{ end }}
{{ if $.Param "poweredby" }}<p>Powered by <a href="https://gohugo.io/">Hugo</a> and the <a href="https://github.com/frjo/hugo-theme-zen">Zen theme</a>.</p>{{ end }}

View file

@ -1,3 +1,6 @@
{{- /* Browser UI colours, the same as the page backgrounds in assets/css/_custom.css. */ -}}
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#e2eed6">
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#001300">
{{- /*
Open Graph image for link previews. The theme's head/meta.html writes og:image only for the
"image" param; without it, this uses the first image in the page, a Markdown image or a

View file

@ -0,0 +1,21 @@
{{- /* Override of the theme's language selector: the icon sits inside the link, so the whole chip is clickable.
After a theme update, compare with themes/zen/layouts/_partials/language-selector.html. */ -}}
{{- $icon := `<svg version="1.0" xmlns="http://www.w3.org/2000/svg" class="language-icon" viewBox="0 0 961 1113" aria-hidden="true">
<path d="M848 3a17654 17654 0 00-349 118l-39 13-6 2-171-60-173-62c-2 0-2 6-2 118v119l-50 16-53 19c-5 3-5-19-5 343 0 335 0 336 2 339l6 5a92499 92499 0 00459-150l12-4 10 3 467 148 4 2V302l-45-15-45-14-1-132c0-124-1-132-2-134-4-7-9-8-19-5zm-4 145l-1 117-178-57-178-57L843 30l1 118zM458 481l-1 319-216 72-216 72V305l215-72 217-72 1 320zm262-131c17 4 30 9 30 9 1 0 20 67 42 149l57 203 15 56-64-19a2060 2060 0 01-24-84 2094 2094 0 00-130-40l-15 33-14 34-64-18 22-55 55-136 46-112c10-24 13-30 14-30l31 10z"/>
<path d="M257 360l-35 9c-23 7-25 7-34 7a72 72 0 01-20-3c-1 1 2 11 5 18 4 8 13 17 23 21 6 3 7 3 18 3 19 0 37-6 52-17 12-8 16-18 15-29-2-11-8-13-24-9zM335 413l-35 16c-13 7-23 12-28 13l-38 12a1636 1636 0 01-106 32c-19 3-17 2-17 9l2 8c2 4 9 10 14 12 12 6 42 3 51-6 2-2 3-3 3-7v-6l31-10 40-11a515 515 0 0148-13l-48 96c-10 19-23 40-45 71l-52 71-55 64-7 8h4c7 0 17-2 20-4a929 929 0 00149-179l23 17c26 20 30 23 51 35 25 14 39 21 56 27 8 2 12 3 13 1 1-4-6-30-9-33l-26-12-47-20-40-17-16-7 10-17c22-35 34-56 53-95l20-40 1-10v-11h-3l-17 6zM716 451l-23 56-23 55 86 26a4814 4814 0 00-40-137zM680 972a460 460 0 0026 44 422 422 0 01-319 66 517 517 0 01-175-66c-7-3-14-2-17 4-2 3-2 9 0 12s24 16 46 27a536 536 0 00222 53c36 1 39 0 68-4a480 480 0 00181-65l8-5 12 21 13 19 7-19 17-48 10-32-99-7z"/>
</svg>` -}}
<nav class="language-selector layout__language-selector" aria-label="{{ i18n "lang_select_title" }}">
<ul class="flex-inline mx--0">
{{ if .IsTranslated -}}
{{ range .Translations -}}
<li><a rel="alternate" href="{{ .RelPermalink }}" hreflang="{{ .Site.Language.Locale | default .Language.Name }}" lang="{{ .Site.Language.Locale | default .Language.Name }}">{{ $icon | safeHTML }}<span>{{ .Language.Label }}</span></a></li>
{{ end -}}
{{ else -}}
{{ range hugo.Sites -}}
{{ if ne $.Language.Name .Language.Name -}}
<li><a rel="alternate" href="{{ .Home.RelPermalink }}" hreflang="{{ .Language.Locale | default .Language.Name }}" lang="{{ .Language.Locale | default .Language.Name }}">{{ $icon | safeHTML }}<span>{{ .Language.Label }}</span></a></li>
{{ end -}}
{{ end -}}
{{ end -}}
</ul>
</nav>

View file

@ -0,0 +1,10 @@
{{- /*
40C3 text logo, picked to suit the colour scheme: green on dark, dark text colour on light.
Params: class (optional, on the picture element).
*/ -}}
{{- $light := resources.Get "img/40c3/logo-text-b.svg" -}}
{{- $dark := resources.Get "img/40c3/logo-text-0.svg" -}}
<picture{{ with .class }} class="{{ . }}"{{ end }}>
<source srcset="{{ $dark.RelPermalink }}" media="(prefers-color-scheme: dark)">
<img src="{{ $light.RelPermalink }}" alt="40C3 MODEL_CITIZENS" width="138" height="71" loading="lazy">
</picture>

View file

@ -1,4 +1,9 @@
<nav class="main-menu{{ if not ($.Param "menuinheader") }} mx--xs layout__navigation{{ end }}" aria-label="{{ i18n "menu_title" }}">
{{- /* Nav row: the main menu, and the language switch on the right.
On small screens the theme's mobilemenu.js hides .main-menu and .header__region (it fails if
either is missing) and the mobile sheet shows both instead. */ -}}
<div class="nav-bar mx--xs layout__navigation">
<div class="nav-bar__row">
<nav class="main-menu" aria-label="{{ i18n "menu_title" }}">
<ul class="flex-inline mx--0">
{{ $currentPage := . -}}
{{ range site.Menus.main -}}
@ -6,3 +11,6 @@
{{ end -}}
</ul>
</nav>
<div class="region header__region">{{ if hugo.IsMultilingual }}{{ partial "language-selector.html" . }}{{ end }}</div>
</div>
</div>

View file

@ -8,7 +8,7 @@
<rect width="80" height="12" x="10" y="70" rx="5"></rect>
</svg>
</button>
<div class="mobile-nav__sheet link-nav" id="sheet" data-theme="dark" aria-hidden="true">
<div class="mobile-nav__sheet link-nav" id="sheet" aria-hidden="true">
<div class="mobile-nav__region">{{ if hugo.IsMultilingual }}{{ partial "language-selector.html" . }}{{ end }}</div>
<nav class="mobile-nav__main-menu" aria-label="{{ i18n "menu_title" }}">
<ul class="mobile-nav__navbar">

View file

@ -0,0 +1 @@
{{- partial "logo-40c3.html" (dict "class" "event-logo") -}}

View file

@ -20,23 +20,26 @@
<body class="{{ if .IsPage }}single-page{{ else }}list-page{{ end }}{{ if .IsHome }} front{{ end }}{{ with .Section }} section-page--{{ . | urlize }}{{ end }}{{ with $.Param "bodyclass" }} {{ . }}{{ end }}">
<a class="skip-link visually-hidden" href="#main-content">{{ i18n "skip_to_content" }}</a>
<div class="page layout__page{{ if $.Param "sidebar" }} layout__sidebar-second{{ end }}">
{{ $home := site.Home -}}
<header class="header layout__header">
{{ if $.Param "logo" | default true -}}
<a href="{{ site.Home.RelPermalink }}" rel="home" class="header__logo">
<img src="{{ with $.Param "logopath" }}{{ . | relURL }}{{ else }}{{ "images/logo.png" | relURL }}{{ end }}"{{ with $.Param "logowidth" }} width="{{ . }}"{{ end }}{{ with $.Param "logoheight" }} height="{{ . }}"{{ end }} alt="{{ i18n "logo_alt" }}" class="header__logo-image">
{{ if $home.Param "logo" | default true -}}
<a href="{{ $home.RelPermalink }}" rel="home" class="header__logo">
<img src="{{ with $home.Param "logopath" }}{{ . | relURL }}{{ else }}{{ "images/logo.png" | relURL }}{{ end }}"{{ with $home.Param "logowidth" }} width="{{ . }}"{{ end }}{{ with $home.Param "logoheight" }} height="{{ . }}"{{ end }} alt="{{ i18n "logo_alt" }}" class="header__logo-image">
</a>
{{ end -}}
<div class="header__intro">
<div class="header__intro_headline"><a href="{{ site.Home.RelPermalink }}" class="header__site-link" rel="home"><span>{{ site.Title }}</span></a></div>
<div class="header__intro_text">{{ .Param "intro" }}</div>
</div>
<div class="region header__region">
{{ if hugo.IsMultilingual }}{{ partial "language-selector.html" . }}{{ end -}}
{{ if $.Param "menuinheader" }}{{ partial "menu.html" . }}{{ end -}}
{{ if .IsHome }}
<h1 class="header__intro_headline">{{ site.Title }}</h1>
{{ else }}
<div class="header__intro_headline"><a href="{{ $home.RelPermalink }}" class="header__site-link" rel="home">{{ site.Title }}</a></div>
{{ end }}
{{ with $home.Param "intro" }}
<div class="header__intro_text">{{ . }}</div>
{{ end }}
</div>
</header>
{{ if not ($.Param "menuinheader") }}{{ partial "menu.html" . }}{{ end -}}
{{ partial "menu.html" . }}
{{ if $.Param "mobilemenu" }}{{ partial "mobilemenu.html" . }}{{ end -}}
<div id="main-content" tabindex="-1"></div>

View file

@ -1,56 +0,0 @@
<!DOCTYPE html>
<html class="nojs" lang="{{ site.Language.Locale | default site.Language.Name }}" dir="{{ site.Language.Direction | default "ltr" }}"{{ with $.Param "colorScheme" }} data-theme="{{ . }}"{{ end }}>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>{{ block "title" . }}{{ .Title }} – {{ site.Title }}{{ end }}</title>
{{ partial "head/meta.html" . }}
{{ partialCached "head/favicons.html" . }}
{{ partialCached "head/styles.html" . }}
{{ partial "head/meta-json-ld.html" . }}
{{ partial "head/scripts.html" . }}
{{ partial "head/math.html" . }}
{{ partialCached "head/tracking.html" . }}
{{ partial "head/extra.html" . }}
{{ block "head" . }}{{ end }}
{{ if .HasShortcode "schedule" }}{{ partial "schedule-script.html" . }}{{ end }}
{{ if .HasShortcode "gallery" }}{{ partial "gallery-script.html" . }}{{ end }}
</head>
<body class="{{ if .IsPage }}single-page{{ else }}list-page{{ end }}{{ if .IsHome }} front{{ end }}{{ with .Section }} section-page--{{ . | urlize }}{{ end }}{{ with $.Param "bodyclass" }} {{ . }}{{ end }}">
<a class="skip-link visually-hidden" href="#main-content">{{ i18n "skip_to_content" }}</a>
<div class="page layout__page{{ if $.Param "sidebar" }} layout__sidebar-second{{ end }}">
<header class="header layout__header">
{{ if $.Param "logo" | default true -}}
<a href="{{ site.Home.RelPermalink }}" rel="home" class="header__logo">
<img src="{{ with $.Param "logopath" }}{{ . | relURL }}{{ else }}{{ "images/logo.png" | relURL }}{{ end }}"{{ with $.Param "logowidth" }} width="{{ . }}"{{ end }}{{ with $.Param "logoheight" }} height="{{ . }}"{{ end }} alt="{{ i18n "logo_alt" }}" class="header__logo-image">
</a>
{{ end -}}
<div class="header__intro">
<h1 class="header__intro_headline">{{ .Param "headline" }}</h1>
{{ if .Param "intro" }}
<div class="header__intro_text">{{ .Param "intro" }}</div>
{{ end }}
</div>
<div class="region header__region">
{{ if hugo.IsMultilingual }}{{ partial "language-selector.html" . }}{{ end -}}
{{ if $.Param "menuinheader" }}{{ partial "menu.html" . }}{{ end -}}
</div>
</header>
{{ if not ($.Param "menuinheader") }}{{ partial "menu.html" . }}{{ end -}}
{{ if $.Param "mobilemenu" }}{{ partial "mobilemenu.html" . }}{{ end -}}
<div id="main-content" tabindex="-1"></div>
{{ block "main" . }}{{ end }}
{{ if $.Param "sidebar" }}{{ partial "sidebar.html" . }}{{ end -}}
<footer class="footer layout__footer mt--l">
{{ partial "footer.html" . }}
</footer>
{{ if $.Param "cookieconsent" }}{{ partialCached "cookieconsent.html" . }}{{ end -}}
</div>
</body>
</html>