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

Prepend 'html_baseurl' to the href of each switching item in versions.html? #3626

Open
hwhsu1231 opened this issue Mar 12, 2024 · 2 comments
Assignees

Comments

@hwhsu1231
Copy link

Problem Description

Hello, Conan Team.

I wonder whether it's possible to prepend html_baseurl to the href of each switching item in versions.html?

That is, replace this line:

<dd><a href="/{{ the_version }}/index.html">{{ the_version }}</a></dd> 

with:

<dd><a href="${{ html_baseurl }}/{{ the_version }}/index.html">{{ the_version }}</a></dd> 

If possible, how to pass and reference html_baseurl in versions.html?

@RubenRBS
Copy link
Member

RubenRBS commented Mar 12, 2024

Hi @hwhsu1231 thanks for your request. I'd like to understand a bit better why you'd need to get the base url as part of the link? Why does the current relative behaviour not work in your case? Are you building locally? Or is this some issue with the current live page itself that you've identified? :)

If possible, how to pass and reference html_baseurl in versions.html?

You'd probably need to add the relevant variable to this dict to make it available in the html context if it's not there already: https://github.com/conan-io/docs/blob/2404156c29d1b91c564dbe1e2f208bba2a87e414/conf.py#L63C1-L63C13

@hwhsu1231
Copy link
Author

hwhsu1231 commented Mar 12, 2024

Hello, @RubenRBS

Are you building locally?

Yes, I am. And if html_baseurl can be prepended to it, we might be able to experience the version switcher of Conan Documentation by running sphinx-build command with -D html_baseurl=<local/path> argument in the local build.

Otherwise, the hyperlinks when hovering those items will be something like these:

file:///2/index.html
file:///2.0/index.html

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

No branches or pull requests

2 participants