Skip to content

Add Announcement Banner per #118#499

Merged
oraNod merged 16 commits intoansible-community:mainfrom
x1101:main
Jan 12, 2026
Merged

Add Announcement Banner per #118#499
oraNod merged 16 commits intoansible-community:mainfrom
x1101:main

Conversation

@x1101
Copy link
Contributor

@x1101 x1101 commented Dec 4, 2025

This is the framework for adding a banner. To enable it change
show_banner: False to show_banner: True in data/top-banner.yaml

For local testing, once you run nikola serve (or nox serve), you need to edit the html to point to the local main.css instead of the hosted version.

Changes:

  • conf.py: loading banner data
  • data/top-banner.yaml: banner content and toggle
  • templates/top-banner.tmpl: template for loading banner
  • themes/ansible-community/sass/_top-banner.scss: banner styling
  • themes/ansible-community/sass/main.scss: minor changes to support banner
  • themes/ansible-community/templates/base.tmpl: change to include banner when enabled

x1101 added 2 commits December 4, 2025 14:24
Changes:
- `conf.py`: loading banner data
- `data/top-banner.yaml`: banner content and toggle
- `templates/top-banner.tmpl`: template for loading banner
- `themes/ansible-community/sass/_top-banner.scss`: banner styling
- `themes/ansible-community/sass/main.scss`: minor changes to support banner
- `themes/ansible-community/templates/base.tmpl`: change to include
  banner when enabled
@x1101
Copy link
Contributor Author

x1101 commented Dec 4, 2025

This is a basic framework for a banner. I'm happy for feedback on the implementation, on style changes, and on how we can document this for ease of use.

Copy link
Contributor

@oraNod oraNod left a comment

Choose a reason for hiding this comment

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

Hey @x1101 Thanks a mill! This looks like a good approach to me although I still need to build locally and play around with it.

Sorry for the nits but I see some missing empty lines at EOF. Could you fix those please?

@x1101
Copy link
Contributor Author

x1101 commented Dec 12, 2025

Sorry for the nits but I see some missing empty lines at EOF. Could you fix those please?

Most recent commit should include fixes for this too.

Co-authored-by: Don Naro <dnaro@redhat.com>
@oraNod
Copy link
Contributor

oraNod commented Dec 15, 2025

Looking good @x1101 Let's see if we can get #500 merged so we can rebase and get the banner to show up in PR previews for other reviewers.

@oraNod
Copy link
Contributor

oraNod commented Dec 16, 2025

@x1101 Now that #500 is merged do you want to see if adding BANNER = True to https://github.com/ansible-community/ansible-docsite/blob/main/dev.conf.py displays the banner in the preview build?

@x1101
Copy link
Contributor Author

x1101 commented Dec 17, 2025

Yeah, I'll get my branch rebased and test this out.

@x1101
Copy link
Contributor Author

x1101 commented Dec 19, 2025

@x1101 Now that #500 is merged do you want to see if adding BANNER = True to https://github.com/ansible-community/ansible-docsite/blob/main/dev.conf.py displays the banner in the preview build?

I ended up having to do
GLOBAL_CONTEXT.update({ "BANNER": True, })
to successfully override the default BANNER = False in conf.py. I believe this is because dev.conf.py isn't used until after GLOBAL_CONTEXT is set, and so its not updated by changing the variable.

@oraNod
Copy link
Contributor

oraNod commented Jan 7, 2026

@x1101 Now that #500 is merged do you want to see if adding BANNER = True to https://github.com/ansible-community/ansible-docsite/blob/main/dev.conf.py displays the banner in the preview build?

I ended up having to do GLOBAL_CONTEXT.update({ "BANNER": True, }) to successfully override the default BANNER = False in conf.py. I believe this is because dev.conf.py isn't used until after GLOBAL_CONTEXT is set, and so its not updated by changing the variable.

Hey @x1101 Thanks for this! That makes sense to me, glad you figured it out. I've added @felixfontein as a reviewer who might have an opinion on the whole approach.

I also added @samccann and @gundalow as reviewers so they can provide thoughts on the banner itself.

Copy link
Contributor

@gundalow gundalow left a comment

Choose a reason for hiding this comment

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

Thanks for this. I like the approach.
Just a minor tweak to add the URL and Community Tracking ID to the Summit website. Not needed, this is just demo

Copy link
Contributor

@oraNod oraNod left a comment

Choose a reason for hiding this comment

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

A few minor nits but I think we're ready to go. Thanks again for doing this work @x1101

dev.conf.py Outdated
Comment on lines 4 to 5
# 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.

… leaving the banner disabled. Per suggestions from @oraNod
Copy link
Contributor

@oraNod oraNod left a comment

Choose a reason for hiding this comment

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

Thanks very much @x1101

@oraNod oraNod merged commit 6711bd7 into ansible-community:main Jan 12, 2026
5 checks passed
@gundalow
Copy link
Contributor

Does the banner go through any rendering functions? I can't get markdown links to render.

@oraNod
Copy link
Contributor

oraNod commented Jan 16, 2026

Does the banner go through any rendering functions? I can't get markdown links to render.

Nah, it's HTML in YAML. 🤘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments