diff --git a/content/de/posts/Route_Hansaplatz_mit_Beschreibung.png b/content/de/posts/2024-12-29-hansaplatz/Route_Hansaplatz_mit_Beschreibung.png similarity index 100% rename from content/de/posts/Route_Hansaplatz_mit_Beschreibung.png rename to content/de/posts/2024-12-29-hansaplatz/Route_Hansaplatz_mit_Beschreibung.png diff --git a/content/de/posts/2024-12-29-hansaplatz.md b/content/de/posts/2024-12-29-hansaplatz/index.md similarity index 100% rename from content/de/posts/2024-12-29-hansaplatz.md rename to content/de/posts/2024-12-29-hansaplatz/index.md diff --git a/i18n/de.yaml b/i18n/de.yaml index d85697f..900c88b 100644 --- a/i18n/de.yaml +++ b/i18n/de.yaml @@ -8,4 +8,7 @@ map_39c3_title: "Karte der 39C3-Touren mit Wegen vom CCH (uMap)" calendar_meeting_point: "Hackertours-Desk" calendar_ics: "iCal Download" calendar_google: "Google Calendar" +skip_to_content: "Zum Inhalt springen" +logo_alt: "Hamburg Hackertours – Startseite" +map_39c3_title: "Karte der 39C3-Touren mit Wegen vom CCH (uMap)" schedule_soldout: "ausgebucht" diff --git a/i18n/en.yaml b/i18n/en.yaml index af56ac6..acb7f30 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -8,4 +8,7 @@ map_39c3_title: "Map of the 39C3 tours with routes from the CCH (uMap)" calendar_meeting_point: "Hackertours Desk" calendar_ics: "iCal download" calendar_google: "Google calendar" +skip_to_content: "Skip to content" +logo_alt: "Hamburg Hackertours – home page" +map_39c3_title: "Map of the 39C3 tours with routes from the CCH (uMap)" schedule_soldout: "fully booked" diff --git a/layouts/_partials/head/extra.html b/layouts/_partials/head/extra.html new file mode 100644 index 0000000..8a5efda --- /dev/null +++ b/layouts/_partials/head/extra.html @@ -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*]+)` .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 }} + +{{- with $width }} + + +{{- end }} +{{- with $alt }} + +{{- end }} + + {{- end -}} + {{- end -}} +{{- end -}}