Skip to content
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

Add version switch to docs #457

Merged
merged 7 commits into from
Jul 27, 2023
Merged

Add version switch to docs #457

merged 7 commits into from
Jul 27, 2023

Conversation

savente93
Copy link
Contributor

@savente93 savente93 commented Jul 25, 2023

Issue addressed

Fixes #188

Explanation

simplay followed the link and followed the docs. Works just fine. The only downside is that the older versions of the docs don't have this added so once you switch, the menu for it disapears. Can go back and retroactively add this back to the older versions if necessary, but this could give issues with reproducability (e.g. not sure if this plugin is compatable with older doc versions.)

Checklist

  • Updated tests or added new tests
  • Branch is up to date with main
  • Tests & pre-commit hooks pass
  • Updated documentation if needed
  • Updated changelog.rst if needed

Additional Notes (optional)

Currently the url of the version switcher points to a file that will be deleted when the branch is deleted. Once this is approved, I'll switch it over to where the file will live after merging. This will temporary break the docs between update and merging as the file needs to be found for the docs to be generated, but should this should be fixed as soon as the merge is complete, so it should be fine.

Copy link
Contributor

@hboisgon hboisgon left a comment

Choose a reason for hiding this comment

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

Nice change! Thanks @savente93

docs/conf.py Outdated Show resolved Hide resolved
Copy link
Contributor

@DirkEilander DirkEilander left a comment

Choose a reason for hiding this comment

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

Looks good to me! Just one small addition, could you add a step to the release guide docs to make sure the switcher.json file gets updated on every release?

@DirkEilander
Copy link
Contributor

The only downside is that the older versions of the docs don't have this added so once you switch, the menu for it disapears.

Can't we add this file to the root of the gh-pages branch directly? The url would than be "https://github.com/Deltares/hydromt/blob/gh-pages/switcher.json" and that should work for all versions right?

@savente93
Copy link
Contributor Author

The only downside is that the older versions of the docs don't have this added so once you switch, the menu for it disapears.

Can't we add this file to the root of the gh-pages branch directly? The url would than be "https://github.com/Deltares/hydromt/blob/gh-pages/switcher.json" and that should work for all versions right?

That's actually a really good idea. Although it won't make it appear on the older versions, that is a config setting, so we'd have to go back to all the previous versions of the docs and add it to the config to solve this issue

@savente93 savente93 merged commit c0083d2 into main Jul 27, 2023
2 checks passed
@savente93 savente93 deleted the doc-version-switcher branch July 27, 2023 07:00
savente93 added a commit that referenced this pull request Jul 31, 2023
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.

Add a version switcher on the docs
3 participants