diff --git a/content/en/_index.md b/content/en/_index.md index 12a2ece429a2..34faed7154cf 100644 --- a/content/en/_index.md +++ b/content/en/_index.md @@ -3,13 +3,25 @@ title: OpenTelemetry description: >- High-quality, ubiquitous, and portable telemetry to enable effective observability -show_banner: true outputs: - HTML - REDIRECTS # Include this `content/en` ONLY developer_note: The blocks/cover shortcode (used below) will use as a background image any image file containing "background" in its name. +show_banner: true +limit_banner: 2 # Default to 2, adjust as needed +banners: + - message: + ' Join us for [**OTel Community Day** on + June + 25th](https://events.linuxfoundation.org/open-telemetry-community-day/)!' + to: 2024-06-25 + - message: + ' Help improve OTel and Prometheus + interoperability: [complete our + survey](https://forms.gle/bZAG9f7udoJsjZUG9) by May 31' + to: 2024-05-31 ---
diff --git a/layouts/partials/banner.md b/layouts/partials/banner.md index 8c913c87c6f4..11439c7851dc 100644 --- a/layouts/partials/banner.md +++ b/layouts/partials/banner.md @@ -1,17 +1,20 @@ -{{/* cSpell:ignore contribfest */ -}} -{{ if .Params.show_banner -}} - +{{/* cSpell:ignore markdownify */ -}} +{{ if and .Params.show_banner (gt (len (.Params.banners | default slice)) 0) }} + {{ $limit := .Params.limit_banner | default 2 }} + {{ $sorted := sort .Params.banners "to" }} + {{ $currentDate := now.Format "2006-01-02" }} + {{ $filtered := slice }} + {{ range $sorted }} + {{ if le $currentDate .to }} + {{ if lt (len $filtered) $limit }} + {{ $filtered = $filtered | append . }} + {{ end }} + {{ end }} + {{ end }}
- - Join us for -[**OTel Community Day** on June 25th](https://sessionize.com/OTel-Community-Day/)! - - + {{ range $filtered }} - -Help improve OTel and Prometheus interoperability: [complete our survey](https://forms.gle/bZAG9f7udoJsjZUG9) by May 31 -{.pt-0} - - +{{ .message | markdownify }} + {{ end }}
-{{ end -}} +{{ end -}} \ No newline at end of file