diff --git a/conf.py b/conf.py index 1cd1b4da..9e739fb3 100644 --- a/conf.py +++ b/conf.py @@ -1416,6 +1416,10 @@ # those. # TEMPLATE_FILTERS = {} +# Display a banner at the top of all pages. +# Banner text is defined in data/top-banner.yaml. +BANNER = False + # Put in global_context things you want available on all your templates. # It can be anything, data, functions, modules, etc. try: @@ -1431,6 +1435,8 @@ "community": load_data('data/community.yaml'), "collections": load_data('data/collections.yaml'), "archive": load_data('data/archive.yaml'), + "banner": load_data('data/top-banner.yaml'), + "BANNER": BANNER, } except ImportError: diff --git a/data/top-banner.yaml b/data/top-banner.yaml new file mode 100644 index 00000000..9078258f --- /dev/null +++ b/data/top-banner.yaml @@ -0,0 +1 @@ +banner_text: Join us for Red Hat Summit & Ansible Fest in Atlanta, GA | May 11-14, 2026 diff --git a/dev.conf.py b/dev.conf.py index d6ff5364..455a3445 100644 --- a/dev.conf.py +++ b/dev.conf.py @@ -1,2 +1,6 @@ from conf import * URL_TYPE = 'rel_path' + +# Override to display the global banner +# GLOBAL_CONTEXT.update({ "BANNER": True, }) + diff --git a/templates/top-banner.tmpl b/templates/top-banner.tmpl new file mode 100644 index 00000000..6e6737cb --- /dev/null +++ b/templates/top-banner.tmpl @@ -0,0 +1 @@ +
diff --git a/themes/ansible-community/sass/_top-banner.scss b/themes/ansible-community/sass/_top-banner.scss new file mode 100644 index 00000000..2f6b777a --- /dev/null +++ b/themes/ansible-community/sass/_top-banner.scss @@ -0,0 +1,11 @@ +#top-banner { + top: 0; + position: sticky; + padding: 0.75rem 1.25rem; + text-align: center; + background-color: $navy; + color: $white; + z-index: 9999; + font-size: $font-md; + line-height: 1.4; +} diff --git a/themes/ansible-community/sass/main.scss b/themes/ansible-community/sass/main.scss index 4502c44b..a2361737 100644 --- a/themes/ansible-community/sass/main.scss +++ b/themes/ansible-community/sass/main.scss @@ -25,6 +25,7 @@ @import "ecosystem"; @import "ansible-prior-versions"; @import "ansible-content"; +@import "top-banner"; body { background: $white; diff --git a/themes/ansible-community/templates/base.tmpl b/themes/ansible-community/templates/base.tmpl index 33ece0e5..1ead8ba6 100644 --- a/themes/ansible-community/templates/base.tmpl +++ b/themes/ansible-community/templates/base.tmpl @@ -11,6 +11,9 @@ +{% if BANNER %} + {% include "top-banner.tmpl" %} +{% endif %}