Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1416,6 +1416,9 @@
# those.
# TEMPLATE_FILTERS = {}

# Display a banner with special text to the top of all pages.
BANNER = False

# Put in global_context things you want available on all your templates.
# It can be anything, data, functions, modules, etc.
try:
Expand All @@ -1431,6 +1434,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:
Expand Down
1 change: 1 addition & 0 deletions data/top-banner.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
banner_text: Join us for Red Hat Summit & Ansible Fest in Atlanta, GA | May 11-14, 2026
4 changes: 4 additions & 0 deletions dev.conf.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
from conf import *
URL_TYPE = 'rel_path'

# Update GLOBAL_CONTEXT["BANNER"] to True
GLOBAL_CONTEXT.update({ "BANNER": True, })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Update GLOBAL_CONTEXT["BANNER"] to True
GLOBAL_CONTEXT.update({ "BANNER": True, })
# Override to display the global banner
# GLOBAL_CONTEXT.update({ "BANNER": True, })

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's probably worth commenting this override so the banner is not displayed on subsequent PRs and we don't forget how to update the global context.


1 change: 1 addition & 0 deletions templates/top-banner.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div class="top-banner" id="top-banner">{{ banner.banner_text }}</div>
11 changes: 11 additions & 0 deletions themes/ansible-community/sass/_top-banner.scss
Original file line number Diff line number Diff line change
@@ -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;
}
1 change: 1 addition & 0 deletions themes/ansible-community/sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
@import "ecosystem";
@import "ansible-prior-versions";
@import "ansible-content";
@import "top-banner";

body {
background: $white;
Expand Down
3 changes: 3 additions & 0 deletions themes/ansible-community/templates/base.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
</head>
<body id="top">

{% if BANNER %}
{% include "top-banner.tmpl" %}
{% endif %}
<div class="global-container" id="content" role="main">
{% if permalink == '/' %}
{% block hero_content %}{% endblock hero_content %}
Expand Down