Skip to content

Commit

Permalink
feat: added dokka templates directory for kotlinlang
Browse files Browse the repository at this point in the history
  • Loading branch information
berezinant committed Aug 23, 2024
1 parent ec78eea commit 20ce356
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ plugins {
}

tasks.withType<DokkaTaskPartial>().configureEach {
pluginsMapConfiguration.set(mapOf("org.jetbrains.dokka.base.DokkaBase" to """{ "templatesDir" : "${projectDir.toString().replace('\\', '/')}/../dokka-templates" }"""))

dokkaSourceSets.configureEach {
includes.from("Module.md")

Expand Down
3 changes: 3 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ kover {
}
}
}
tasks.dokkaHtmlMultiModule {
pluginsMapConfiguration.set(mapOf("org.jetbrains.dokka.base.DokkaBase" to """{ "templatesDir" : "${projectDir.toString().replace('\\', '/')}/dokka-templates" }"""))
}
12 changes: 12 additions & 0 deletions dokka-templates/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Dokka's template customization
To provide unified navigation for all parts of [kotlinlang.org](https://kotlinlang.org/),
the Kotlin Website Team uses this directory to place custom templates in this folder
during the website build time on TeamCity.

It is not practical to place these templates in the kotlinx.metadata repository because they change from time to time
and aren't related to the library's release cycle.

The folder is defined as a source for custom templates by the templatesDir property through Dokka's plugin configuration.

[Here](https://kotlinlang.org/docs/dokka-html.html#templates), you can
find more about the customization of Dokka's HTML output.
15 changes: 15 additions & 0 deletions dokka-templates/base.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html class="no-js">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
</head>
<body>
<H1>I'm a custom template</H1>
<div class="root">
<div id="container">
<div id="main">
</div>
</div>
</div>
</body>
</html>

0 comments on commit 20ce356

Please sign in to comment.