From 26dde5b201b3c7e66212b07ddef333a3e340022a Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Wed, 27 Jul 2022 18:53:23 +0200 Subject: Make current breadcrumb element not clickable and of default font color (#2588) --- .../base/src/main/kotlin/renderers/html/HtmlRenderer.kt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'plugins/base/src/main/kotlin') 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 -> -- cgit