Files
website/layouts/_partials/banner.html
T
yann64andClaude Opus 5.5 d9227e15f3 Add news posts with banner summaries on the home page
Posts live in content/post/; the five latest are summarised on the home
page. Builds for check/deploy go to build/ so they do not collide with a
running hugo server writing to public/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YDRjtmAiNpo5mK5N3d7QwZ
2026-10-11 20:13:17 +02:00

15 lines
497 B
HTML

{{/* dict "page" <post> "width" <px> -> URL of the post banner, resized when it is a bundle image */}}
{{- $url := "" -}}
{{- with .page.Params.banner -}}
{{- with $.page.Resources.GetMatch . -}}
{{- if and (eq .MediaType.MainType "image") (ne .MediaType.SubType "svg") -}}
{{- $url = (.Resize (printf "%dx" $.width)).RelPermalink -}}
{{- else -}}
{{- $url = .RelPermalink -}}
{{- end -}}
{{- else -}}
{{- $url = . -}}
{{- end -}}
{{- end -}}
{{- return $url -}}