Rebased onto main after the bottom navigation bar (#68). Main's markup and behaviour win; this commit only contributes the 40c3 look. - Jersey 10 and Hack fonts, the 40c3 palette and light/dark schemes, theme-color metas, web manifest and the 40c3 logo/footer. - Header: site name as green chip; nav row with the language switch as amber chip. The tagline stays out of the header, as in main. - Mobile (up to 666px): main's bottom navigation bar is kept and restyled (2px borders and dividers, current page green, language switch amber, visible keyboard focus). The old button-and-sheet styling is dropped. - Start pages: 40C3 heading; stale commented-out 39C3 block removed. - layouts/home-baseof.html removed; it was identical to baseof.html. - Removed the leftover 'h2 a' margin that made the news list 2px wider than a 390px viewport. - README: describe the bottom navigation bar. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
54 lines
2.4 KiB
HTML
54 lines
2.4 KiB
HTML
{{- /* 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
|
|
gallery-image shortcode, scaled down to at most 1200 pixels wide, with its alt text as
|
|
og:image:alt.
|
|
*/ -}}
|
|
{{- if not ($.Param "image") -}}
|
|
{{- /* Whichever comes first: a Markdown image or a gallery-image shortcode (src and alt in "…" or `…`). */ -}}
|
|
{{- with findRESubmatch `!\[([^\]]*)\]\(\s*<?([^\s)>]+)|\{\{<\s*gallery-image\s([^}]*)>\}\}` .RawContent 1 -}}
|
|
{{- $alt := index . 0 1 -}}
|
|
{{- $dest := index . 0 2 -}}
|
|
{{- with index . 0 3 -}}
|
|
{{- $dest = "" -}}
|
|
{{- $alt = "" -}}
|
|
{{- with findRESubmatch "\\bsrc=(?:\"([^\"]*)\"|`([^`]*)`)" . 1 }}{{ $dest = or (index . 0 1) (index . 0 2) }}{{ end -}}
|
|
{{- with findRESubmatch "\\balt=(?:\"([^\"]*)\"|`([^`]*)`)" . 1 }}{{ $alt = or (index . 0 1) (index . 0 2) }}{{ end -}}
|
|
{{- end -}}
|
|
{{- $url := "" -}}
|
|
{{- $width := 0 -}}
|
|
{{- $height := 0 -}}
|
|
{{- $resource := false -}}
|
|
{{- if findRE `^https?://` $dest -}}
|
|
{{- $url = $dest -}}
|
|
{{- else -}}
|
|
{{- $resource = or ($.Resources.Get (strings.TrimPrefix "./" $dest)) (resources.Get $dest) -}}
|
|
{{- end -}}
|
|
{{- with $resource -}}
|
|
{{- $image := . -}}
|
|
{{- if and (eq .ResourceType "image") (ne .MediaType.SubType "svg") -}}
|
|
{{- /* Turned as its EXIF orientation says; Hugo doesn't do that when it resizes. */ -}}
|
|
{{- $image = .Filter images.AutoOrient -}}
|
|
{{- if gt $image.Width 1200 }}{{ $image = $image.Resize "1200x" }}{{ end -}}
|
|
{{- $width = $image.Width -}}
|
|
{{- $height = $image.Height -}}
|
|
{{- end -}}
|
|
{{- $url = $image.Permalink -}}
|
|
{{- end -}}
|
|
{{- with $url }}
|
|
<meta property="og:image" content="{{ . }}">
|
|
{{- with $width }}
|
|
<meta property="og:image:width" content="{{ . }}">
|
|
<meta property="og:image:height" content="{{ $height }}">
|
|
{{- end }}
|
|
{{- with $alt }}
|
|
<meta property="og:image:alt" content="{{ . }}">
|
|
{{- end }}
|
|
<meta name="twitter:card" content="summary_large_image">
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|