feat(banner): add top banner (#777)

* feat: add top banner

* chore: use inside the example site

* chore: generate

* fix: banner with the burger navbar

* fix: compute the banner height to allow mutliple lines

* chore: better p style
This commit is contained in:
Ludovic Fernandez
2025-08-24 00:46:29 +02:00
committed by GitHub
parent 990d24906b
commit f297d24189
14 changed files with 96 additions and 3 deletions

View File

@@ -423,3 +423,22 @@ params:
- "/img/config-image.jpg"
audio: "config-talk.mp3"
```
### Banner
To add a banner to your site, add the following to your `hugo.yaml`:
```yaml
params:
banner:
key: 'announcement-xxx'
message: |
🎉 Welcome! [Hextra](https://github.com/hextra/hextra) is a static site generator that helps you build modern websites.
```
The banner will be displayed on all pages.
The field `message` supports Markdown syntax.
If you want to use template syntax, you can define the partial in `layouts/_partials/custom/banner.html`.
In this case, the field `message` will be ignored.