From f73fb0c2fb96da82da0b3b627ff08caf9f9d1335 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Thu, 29 Feb 2024 09:29:22 +0300 Subject: [PATCH] Implement parent context and proper language switch --- src/main/kotlin/center/sciprog/spcMisc.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/center/sciprog/spcMisc.kt b/src/main/kotlin/center/sciprog/spcMisc.kt index f678cfb..4732aef 100644 --- a/src/main/kotlin/center/sciprog/spcMisc.kt +++ b/src/main/kotlin/center/sciprog/spcMisc.kt @@ -1,7 +1,5 @@ package center.sciprog -import io.ktor.http.URLBuilder -import io.ktor.http.appendPathSegments import kotlinx.html.* import space.kscience.dataforge.meta.string import space.kscience.snark.html.* @@ -173,8 +171,9 @@ internal fun wrapper(contentBody: FlowContent.() -> Unit) = postprocess { div { languageMap.forEach { (key, meta) -> a(classes = "button primary small") { - val pageUrl = URLBuilder(host).appendPathSegments(meta.string ?: "#") - href = pageUrl.buildString().removeSuffix("/") //resolveRef(meta.string ?: "#") +// val pageUrl = URLBuilder(host).appendPathSegments(meta.string ?: "#") +// href = pageUrl.buildString().removeSuffix("/") //resolveRef(meta.string ?: "#") + href = page.resolvePageRef(meta.string ?: "#", site.parent!!) +key } }