Usage
{{< hero-message page = ".Page" >}}A message in the hero band, written in the page’s front matter. tool/cover renders it for you whenever the cover emits the page’s h1.
Description
Reads hero-message: from the page’s front matter: one message (a map), or a list of dated messages so next week’s notice can be written today. Each message is html, md or text, optionally with media (an image or video) shown beside it.
Parameters
indicates required parameter
date =
"date"undated: the fallback
Show this entry from this date on. List entries only
html =
"string"
Raw HTML, emitted unchecked. Logs WRN id
pihuw-hero-message-html; silence it with ignoreLogsmd =
"string"
Markdown, rendered with the page’s RenderString
text =
"string"
Plain text, HTML-escaped, no paragraph
media =
"string | map"
Image or video path (as tk/get-asset takes it), or
{src, alt}. alt defaults to “”: decorative
Examples
One message
hero-message:
md: Doors open at **6pm**.A map: shown on every build
Dated messages
hero-message:
- text: Tickets on sale soon.
- date: 2026-10-01
md: Tickets **on sale now**.
- date: 2026-11-08
text: Thank you for coming!Before 1 Oct the undated entry shows; from then the latest dated entry that is due
Media beside the text
hero-message:
media: {src: img/poster.jpg, alt: "This year's poster"}
md: |
Our event is free to attend.
Thank you for your support!A video (an extension in
site.Params.extensions.video) gets controls and never autoplaysPlacing it yourself
{{- partial "tool/cover" (dict "page" .Page "header" .Title
"innerHTML" $extras "message" false) -}}
{{/* ...and inside $extras: */}}
{{- partial "tool/hero-message" (dict "page" .Page) -}}message: false stops cover rendering it, so it is not shown twice
Additional Information