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 generate_redirects function to generate HTML redirects of Documenter sites #76

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mortenpi
Copy link
Member

The use case I imagine here is where you want to move the docs from one domain to another (e.g. when you move the package from one GitHub org to another), but you want to keep the old URLs working(-ish).

The normal process is to just move the gh-pages to the new repo. With this function, you can replace the old site with redirects to the new site.

E.g. let's say you want to move from a github.com/personalusername/MyPackage.jl (docs hosted at https://personalusername.github.io/MyPackage.jl/) to github.com/CentralizedJuliaOrg/MyPackage.jl (with docs hosted at https://centralizedjulia.org/MyPackage.jl.

To do that, you can check out the gh-pages branch locally and run:

DocumenterTools.generate_redirects(
    src = "<path-to-current-gh-pages>",
    out = "...",
    rooturl = "https://centralizedjulia.org/MyPackage.jl",
)

The contents of out should be pushed to the old repository (i.e. personalusername), and then https://personalusername.github.io/MyPackage.jl/... should redirect to the new domain.

Currently builds on top of #75. Needs tests and docs.

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.

1 participant