Best way to add a PyPI badge/link in the header? #7429
-
Hi, I've got this admittedly very basic but very effective and easy site setup for a python package. What would be the best way to get a link to the PyPi entry for my package in the header? I'm thinking it would be placed between the Search field and the git icon in the top right. I think I can find or make a badge that includes the current version number. Is there an existing plugin for this? Is the right thing to override the header partial (copy the whole existing code there)? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hello @bluss, However, as you want to add the badge outside of the content this won't help you, so you're correct in using template customization, and yes you only have to copy the original contents and make your adjustments.
You can use shields.io to generate the badge based on the URL.
You can make a hook to fetch the latest version of your PyPi project via:
You can use extra to pass info from the hook to the templates. |
Beta Was this translation helpful? Give feedback.
Hello @bluss,
I checked the catalog and there is a project for badges in markdown in the content:
However, as you want to add the badge outside of the content this won't help you, so you're correct in using template customization, and yes you only have to copy the original contents and make your adjustments.
You can use shields.io to generate the badge based on the URL.