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

MkDocs documentation leads to the latest snapshot instead of the stable version #2869

Closed
IgnatBeresnev opened this issue Feb 16, 2023 · 0 comments · Fixed by #2870
Closed
Assignees
Labels

Comments

@IgnatBeresnev
Copy link
Member

MkDocs documentation that is hosted on GitHub Pages leads to the latest published version (usually snapshots) instead of the latest release.

How to reproduce

Go to https://kotlin.github.io/dokka, get redirected to https://kotlin.github.io/dokka/1.8.0-SNAPSHOT/

Expected behaviour

Opening https://kotlin.github.io/dokka should lead to the latest stable version, such as https://kotlin.github.io/dokka/1.7.20/

Technical explanation

Dokka's GitHub pages documentation is served from the gh-pages branch.

If you go to kotlin.github.io/dokka, it will open the index.html file found in the root of the branch files.

If you open it, you'll see that it has the redirect to one of the versions of documentation:

<meta http-equiv="refresh" content="0;URL='1.8.0-SNAPSHOT'" />

This index.html file is created by the gradle-mkdocs-plugin we use to build documentation. It is created for every single build and, if it is present, it replaces the old index.html file every time we upload the documentation to the gh-pages branch, so you get the new redirect on every build.

Solution

Do not generate the index.html file with the redirect if you're building documentation for a non-release version, such as -SNAPSHOT or -dev. The documentation will still be accessible with a direct link, but it will be somewhat hidden. Visiting kotlin.github.io/dokka would redirect to the latest release.

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

Successfully merging a pull request may close this issue.

1 participant