Skip to content

Commit f9a7c42

Browse files
committed
feat: Add banner system for important notifications on home page
Signed-off-by: Felicitas Pojtinger <felicitas@pojtinger.com>
1 parent 4ca78e2 commit f9a7c42

4 files changed

Lines changed: 21 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Click on an image to see a larger version.
5656
- [gohugoio/hugo](https://github.com/gohugoio/hugo) provides the static site generator.
5757
- The open source [PatternFly design system](https://www.patternfly.org/) provides the UI components.
5858
- [FortAwesome/Font-Awesome](https://github.com/FortAwesome/Font-Awesome) provides the icons.
59-
- [lu.ma](https://lu.ma/) provides the event calendar and API.
59+
- [Luma](https://luma.com/home) provides the event calendar and API.
6060

6161
## Contributing
6262

data/banner.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
enabled: true
2+
color: info # info, warning, danger, success, custom
3+
screen_reader_text: "Info:"
4+
icon: fa-info-circle # fa-info-circle (info), fa-exclamation-triangle (warning), fa-exclamation-circle (danger), fa-check-circle (success), fa-bell (custom)
5+
message: "Our next Burnaby talk, Linux Talks (May 23), has changed location from the Bob Prittie Metrotown Branch to the Tommy Douglas Library."
6+
link_text: "RSVP on Luma" # Optional
7+
link_url: "https://luma.com/ahm1hi2s" # Optional

layouts/_partials/banner.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{{ with .Site.Data.banner }}
2+
{{ if .enabled }}
3+
<div class="pf-v6-c-banner pf-m-sticky{{ with .color }} pf-m-{{ . }}{{ end }} pf-v6-u-text-align-center" role="status" style="white-space: normal;">
4+
<span class="pf-v6-screen-reader">{{ .screen_reader_text }}</span>
5+
<i class="fas {{ with .icon }}{{ . }}{{ else }}fa-info-circle{{ end }} pf-v6-u-mr-sm" aria-hidden="true"></i>
6+
{{- .message -}}
7+
{{ if and .link_text .link_url }}
8+
<a href="{{ .link_url }}">{{ .link_text }}{{ partial "icon" "external" }}</a>
9+
{{ end }}
10+
</div>
11+
{{ end }}
12+
{{ end }}

layouts/baseof.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
<div class="pf-v6-c-drawer__content pf-v6-c-page__main-container">
9595
<div class="pf-v6-c-drawer__body">
9696
<main class="pf-v6-c-page__main" id="main-content">
97+
{{ partial "banner" . }}
9798
{{ block "main" . }}{{ end }}
9899
</main>
99100
</div>

0 commit comments

Comments
 (0)