diff --git a/README.md b/README.md index 87d2cd5a57..aad6c6c67c 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Elasticsearch query DSL for Kotlin -Read [User Guide](https://anti-social.github.io/elasticmagic-kt/document/) +Read [User Guide](https://anti-social.github.io/elasticmagic-kt/latest/document/) ## Features diff --git a/build.gradle.kts b/build.gradle.kts index fad477a79e..609c48991a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -186,11 +186,15 @@ mkdocs { // With strict it will fail because of 'api' directory is missing strict = false + val isLatest = grgit.branch.current().name == "master" && docsVersion != "dev" publish.apply { docPath = docsVersion - rootRedirect = grgit.branch.current().name == "master" && docsVersion != "dev" - rootRedirectTo = docsVersion + rootRedirect = isLatest generateVersionsFile = true + if (isLatest) { + rootRedirectTo = "latest" + setVersionAliases("latest") + } } extras = mapOf(