With dokka 1.4.0 and no submodules in the project,...
# dokka
a
With dokka 1.4.0 and no submodules in the project, is there any way to make the
dokkaHtml
task create index.html at the top level rather than nested in a project folder? It's not clear how to publish the output as a static site (e.g. github pages) without having the root 404.
m
Just copy it to where you want, something like:
Copy code
tasks.register<Copy>("githubPages") {
    dependsOn(tasks.named("dokkaHtml"))
    from(project.buildDir.resolve("dokka/html/yourmodule"))
   into(rootProject.rootDir)
}
and call "./gradlew githubPages" instead of "./gradlew dokkaHtml"
a
Thanks for the reply. That was the first thing I tried, but it doesn't seem to work, since files in
dokka/html/module
reference css and other files in
dokka/html
, so copying the
module
contents somewhere else breaks the pages.
m
Well, then what was recommended in https://github.com/Kotlin/dokka/issues/1421#issuecomment-684773170
would relocate documentation either by changing the PageNode structure or the LocationProvider itself.
IMHO adding a toplevel index.html page with url redirect should be sufficient for most use cases (only for the HTML format of course