aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/renderers/html
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat.beresnev@jetbrains.com>2022-07-27 18:53:23 +0200
committerGitHub <noreply@github.com>2022-07-27 18:53:23 +0200
commit26dde5b201b3c7e66212b07ddef333a3e340022a (patch)
tree7a63a244bcf2d9a8b0a031b9b7d82395634ba7fa /plugins/base/src/main/kotlin/renderers/html
parentf4d2bf40e7b7e62aeb27bf0f1cabe53e35e68fd2 (diff)
downloaddokka-26dde5b201b3c7e66212b07ddef333a3e340022a.tar.gz
dokka-26dde5b201b3c7e66212b07ddef333a3e340022a.tar.bz2
dokka-26dde5b201b3c7e66212b07ddef333a3e340022a.zip
Make current breadcrumb element not clickable and of default font color (#2588)
Diffstat (limited to 'plugins/base/src/main/kotlin/renderers/html')
-rw-r--r--plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt14
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt
index 30ae0562..9f568287 100644
--- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt
+++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt
@@ -634,8 +634,18 @@ open class HtmlRenderer(
}
private fun FlowContent.buildNavigationElement(node: PageNode, page: PageNode) =
- if (node.isNavigable) buildLink(node, page)
- else text(node.name)
+ if (node.isNavigable) {
+ val isCurrentPage = (node == page)
+ if (isCurrentPage) {
+ span(classes = "current") {
+ text(node.name)
+ }
+ } else {
+ buildLink(node, page)
+ }
+ } else {
+ text(node.name)
+ }
private fun FlowContent.buildLink(to: PageNode, from: PageNode) =
locationProvider.resolve(to, from)?.let { path ->