Add og:image from the first image in a page; fix Hansaplatz post image
Some checks failed
/ build (push) Successful in 22s
/ accessibility (push) Failing after 23s

This commit is contained in:
Stefan Bethke 2026-10-17 10:09:00 +02:00
commit fd01d9d124
3 changed files with 40 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 MiB

View file

@ -0,0 +1,24 @@
---
title: '38c3: Tour "Überwachungsspaziergang und Demo: KI-Videoüberwachung am Hansaplatz"'
date: 2024-12-21T10:00:00+01:00
tags:
- 38c3
---
Wir tragen den 38c3 auf die Straße und besichtigen den Hansaplatz - das KI-Überwachungslabor der Polizei Hamburg. Gemeinsam unterbrechen wir dort die Überwachung.
Wir fahren gemeinsam vom CCH zum Heidi-Kabel-Platz (direkt neben dem Hauptbahnhof), wo die Veranstaltung um 14:15 Uhr beginnt.
Voraussichtliches Ende der Veranstaltung: 15:10 Uhr
Für diese Tour benötigt ihr ausnahmsweise kein Ticket!
![Wegbeschreibung vom CCH zum Hansaplatz](./Route_Hansaplatz_mit_Beschreibung.png "Wegbeschreibung vom CCH zum Hansaplatz")
Daten:
Tag 3 (29.12.2024) 13:30 Uhr, Treffpunkt an der Fairy Dust - das ist die Rakete in der Haupteingangshalle, Foyer X, EG im CCH.
Dauer: 40 Minuten
Kosten: kostenfrei
Sprache: Deutsch
Barrierefreiheit: Es gibt an den Bahnhöfen Fahrstühle, deren Kapazitäten allerdings beschränkt sind.

View file

@ -0,0 +1,40 @@
{{- /*
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's Markdown, scaled down to at
most 1200 pixels wide, with its alt text as og:image:alt.
*/ -}}
{{- if not ($.Param "image") -}}
{{- with findRESubmatch `!\[([^\]]*)\]\(\s*<?([^\s)>]+)` .RawContent 1 -}}
{{- $alt := index . 0 1 -}}
{{- $dest := index . 0 2 -}}
{{- $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") -}}
{{- if gt .Width 1200 }}{{ $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 -}}