Skip to content

Do not show announcement banner if contents are empty #1695

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

Closed
melissawm opened this issue Jan 31, 2024 · 5 comments · Fixed by #1703
Closed

Do not show announcement banner if contents are empty #1695

melissawm opened this issue Jan 31, 2024 · 5 comments · Fixed by #1703
Labels
kind: enhancement New feature or request

Comments

@melissawm
Copy link
Contributor

melissawm commented Jan 31, 2024

Hello folks!

Over at https://github.com/napari/docs we would like to use a temporary announcement banner on our website. We are pointing to a remote announcement-banner.html file. But in the future, instead of turning temporary announcements on or off on the conf.py file, we would like to not show the announcement space at the top of the page if the contents of the announcement-banner.html file are empty.

I tried poking around and found that it could work if we do the following:

melissawm/pydata-sphinx-theme@master...empty-announcement

Is this an acceptable feature request? If so, I can submit a pull request with the suggestion above. Thanks!

cc @jni

@jni
Copy link

jni commented Jan 31, 2024

Yeah, so the rationale is: updating the conf.py for already deployed sites (such as project.org/stable) is tricky. It's easier if the conf points to (say) project.org/dev/_static/announcement.html, that gets deployed in the conf, and then the banner can be updated by changing the text in that file (simple PR to main) or removed by removing the text altogether (again by a simple PR to main).

Does that make sense to folks?

Thanks @melissawm for getting the ball rolling here!

@Charlie-XIAO
Copy link
Contributor

+1 on this. I am also looking for this feature when switching to pydata-sphinx-theme for scikit-learn.

@drammock
Copy link
Collaborator

drammock commented Feb 1, 2024

Is this an acceptable feature request? If so, I can submit a pull request with the suggestion above.

LGTM. In the PR, can you add a bit to the docs about this feature? Probably in this section: https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/announcements.html#insert-remote-html-with-javascript

@melissawm
Copy link
Contributor Author

Will do, thanks!

@jni
Copy link

jni commented Feb 13, 2024

Incredible! ❤️ 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants