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

Build one ref (e.g. current version) to the top-level #134

Open
The-Ludwig opened this issue Nov 5, 2024 · 3 comments
Open

Build one ref (e.g. current version) to the top-level #134

The-Ludwig opened this issue Nov 5, 2024 · 3 comments
Labels
type:task An atomic feature / thing to be implemented

Comments

@The-Ludwig
Copy link

Problem Description

When building with sphinx-multiversion, each version is build into a subdirectory of the output flag.
I want to have one version (e.g. the current version / main branch) directly at the top level. This is currently not possible via the smv_outpudir format string.

Proposed Solution

My fork solved this by adding a new sphinx variable smv_toplevelref and if it is given,
then the outputdir of the ref with the same name will be manually set to an empty string.

I am happy to merge my fork and write additional documentation for the features, if this is wanted.

@Holzhaus
Copy link
Collaborator

Holzhaus commented Nov 5, 2024

I suppose this implicated a lot of edge cases. What if a branch output dir has the same name as an output dir from sphinx?

@Holzhaus
Copy link
Collaborator

Holzhaus commented Nov 5, 2024

Could you elaborate a bit on the use case? Wouldn't it be sufficient to drop an "index.html" into the top level dir that just redirects to the "index.html" in the main branch output dir?

@The-Ludwig
Copy link
Author

The-Ludwig commented Nov 5, 2024

I suppose this implicated a lot of edge cases. What if a branch output dir has the same name as an output dir from sphinx?

Then this will fail or produce undefined behavior. The fix is easy though: rename the folder. The easiest fix to get this functionality currently is to fork smv.
But I agree, this is one edge case which could need more polishing.

Could you elaborate a bit on the use case? Wouldn't it be sufficient to drop an "index.html" into the top level dir that just redirects to the "index.html" in the main branch output dir?

Yes I can! I do care about nice looking URLs and I know that some people keep the links to the webpage I am deploying. I do not want the old links to become invalid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:task An atomic feature / thing to be implemented
Projects
Status: Backlog
Development

No branches or pull requests

2 participants