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

Specify redirect target in index.html to be dev/? #2127

Closed
fsaad opened this issue May 23, 2023 · 3 comments · Fixed by #2140
Closed

Specify redirect target in index.html to be dev/? #2127

fsaad opened this issue May 23, 2023 · 3 comments · Fixed by #2140

Comments

@fsaad
Copy link
Contributor

fsaad commented May 23, 2023

Related: #937

Is it possible call deploydocs in such a way that the generated index.html file always redirects to ./dev?

It seems the current code automatically determines which of ./stable or ./dev should be used in the redirect, based on the return value of HTMLWriter.expand_versions:

# Expand the users `versions` vector
entries, symlinks = HTMLWriter.expand_versions(dirname, versions)
# Create the versions.js file containing a list of `entries`.
# This must always happen after the folder copying.
HTMLWriter.generate_version_file(joinpath(dirname, "versions.js"), entries, symlinks)
# Create the index.html file to redirect ./stable or ./dev.
# This must always happen after the folder copying.
HTMLWriter.generate_redirect_file(joinpath(dirname, "index.html"), entries)

@fredrikekre
Copy link
Member

Documenter won't change the file if you manage it on your own, specifically, if the comment <!--This file is automatically generated by Documenter.jl--> is not in the file Documenter won't touch it, see https://github.com/JuliaDocs/Documenter.jl/blob/master/src/html/HTMLWriter.jl#L1494-L1496.

(Why would you default to /dev though? Latest stable release seems like a sane default, no?)

@fsaad
Copy link
Contributor Author

fsaad commented May 24, 2023

Thank you for explaining. It would be good document this behavior, in the following line

* Generate `index.html`, and `versions.js` in the `branch` root and
`siteinfo.js` in the deployment directory

@mortenpi
Copy link
Member

Happy to accept a PR to get this documented there 🙂 I'll re-open this, with the docs being the actionable item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants