-
-
Notifications
You must be signed in to change notification settings - Fork 525
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
Update conf.py to dynamically show current release number in announcement text at top of Panel site. #6903
Conversation
Thanks to @hoxbro for pointing out line 77. Announcement now says: "Panel 1.4 has just been released. ..." Introducing a variable that retrieves current version number , so it will say "Panel 1.4.x has just been released. ..." This way the announcement will always show the actual latest release number to new and returning users. More accurate and more informative.
Announcement text said checkout instead of check out :-)
Checks have passed successfully. Does that make sure the version number will display on the site as intended? Or can that only be confirmed after a new build of the site? |
Correct but the change looks safe. |
@@ -43,6 +43,11 @@ | |||
html_theme = "pydata_sphinx_theme" | |||
html_favicon = "_static/icons/favicon.ico" | |||
|
|||
current_release = panel.__version__ # Current release version variable | |||
|
|||
announcement_text = f"Panel {current_release} has just been released! Check out the <a href='https://panel.holoviz.org/about/releases.html#version-1-4-0'>release notes</a> and support Panel by giving it a 🌟 on <a href='https://github.com/holoviz/panel'>Github</a>." |
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.
Arf unfortunately this is not quite correct, annoucement_text
contains a link to releases.html#version-1-4-0
... @Coderambling can you please open a new PR to remove this fragment? No need to build it dynamically I think, since we always want users to see the top of the release notes page.
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.
Yes wel spotted, I will replace that link with the one below ok? That will show the top of the release page.
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.
Ok.
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.
Also, as the next PR after that, the Github API could be used to retrieve the release date, so instead the text would then be
Panel current_release
was released on release_date
.
Would that be an improvement?
Example code to retrieve release date from Github:
`import requests
url = "https://api.github.com/repos/holoviz/panel/releases/latest"
response = requests.get(url)
data = response.json()
print("The latest release date is:", data['published_at'])
`
It would mean importing the requests library in conf.py though. Would that be an issue?
Advantage is that it could then also be used to retrieve the number of Github Panel downloads and forks for display on the site
This would be a good way to communicate to (first time) site visitors that Panel is in active development and is a popular framework.
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.
Updated the hyperlink:
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.
See comment.
Aa discussed with @maximlt, In the below section, the url: https://panel.holoviz.org/about/releases.html#version-1-4-0 Was changed to: https://panel.holoviz.org/about/releases.html See below for comment and explanation: holoviz#6903 (review) announcement_text = f"Panel {current_release} has just been released! Check out the <a href='https://panel.holoviz.org/about/releases.html#version-1-4-0'>release notes</a> and support Panel by giving it a 🌟 on <a href='https://github.com/holoviz/panel'>Github</a>."
Aa discussed with @maximlt, In the below section, the url: https://panel.holoviz.org/about/releases.html#version-1-4-0 Was changed to: https://panel.holoviz.org/about/releases.html See below for comment and explanation: #6903 (review) announcement_text = f"Panel {current_release} has just been released! Check out the <a href='https://panel.holoviz.org/about/releases.html#version-1-4-0'>release notes</a> and support Panel by giving it a 🌟 on <a href='https://github.com/holoviz/panel'>Github</a>."
Hm it seems this wasn't applied. Top of webpages still shows the old text. Is this because it is scheduled to be applied in version 1.5? Or is there another cause? |
Announcement at top of site now says: "Panel 1.4 has just been released. ..."
Introducing a variable that retrieves current version number , so it will say "Panel 1.4.x has just been released. ..."
This way the announcement will always show the actual latest release number to new and returning users. More accurate and more informative.
Also, it will more accurately reflect the fact that Panel has frequent releases. Now it says 1.4 just released for a very long period,.
The announcement is on every page of the website, so every site visitor sees this...
Thanks to @maximlt for pointing out line 77 of conf py .