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

Allow multiple url_template in version switcher #573

Closed
tupui opened this issue Jan 19, 2022 · 5 comments · Fixed by #575
Closed

Allow multiple url_template in version switcher #573

tupui opened this issue Jan 19, 2022 · 5 comments · Fixed by #575

Comments

@tupui
Copy link
Contributor

tupui commented Jan 19, 2022

url_template allows to have a template to build the URL for each versions. The problem is that old versions or development ones can be stored elsewhere and not respect the template.

I can see a few options:

  • Add an optional url in the json configuration which would overwrite url_template.
  • Allow multiple templates in conf.py and add a way to select which template has to be used. Could be a regex with the version/name, another optional parameter in the json, etc.
  • Have another file which would define mapping exceptions.

A use case with discussions can be seen in scipy/scipy#15380

@jorisvandenbossche
Copy link
Member

I suppose having an additional, optional entry in the json file might be the cleanest solution.

Another issue about potentially expanding the json file: #556

@drammock
Copy link
Collaborator

Add an optional url in the json configuration which would overwrite url_template.

I like this option best too.

@tupui
Copy link
Contributor Author

tupui commented Jan 19, 2022

If it's just a matter of adapting the current JS in the HTML (and doc OC), I could give this a try 😃
I've seen the issue about moving the JS out of the HTML, since my JS/HTML skills are "practical" I don't know if adding new features can be done before or if it's better to wait for the move.

@jorisvandenbossche
Copy link
Member

Yes, I think it's certainly fine to improve the current JS, before it is moved. So if you want to give this a try, that would be very welcome!

@tupui
Copy link
Contributor Author

tupui commented Jan 21, 2022

@jorisvandenbossche I created a PR (and another one for the extra classes).

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 a pull request may close this issue.

3 participants