-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOC-1069 Adds the ability to set announcements on the pages too #249
Conversation
✅ Deploy Preview for docs-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Latest change enables page > product > site announcements |
src/partials/head.hbs
Outdated
@@ -12,7 +12,8 @@ | |||
const banner = document.getElementById(bannerId); | |||
if (!banner) return; | |||
|
|||
const hasSeenBanner = window.sessionStorage.getItem(sessionKey) || false; | |||
const storageKey = sessionKey; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might need unique keys for different announcement types. For example, if both site-wide and page-wide is enabled, and I close site-wide, page-wide should stay open
Adds the support to make announcements for specific pages/products/site.
Usage
To add a page-specific announcement add these keys in your page:
To add a product-wide announcement, add those keys in the corresponding
antora.yaml
file:To add a site-wide announcement, continue adding the keys in the corresponding site yaml (playbook). Example with
local-antora-playbook.yaml
:The implementation respects the following order:
page > product > site
PS.
The file announcement-bar was auto-idented, that's why the changes look bigger than they are.