Implement parent context and proper language switch

This commit is contained in:
Alexander Nozik 2024-02-29 09:29:22 +03:00
parent bf746a4227
commit f73fb0c2fb

View File

@ -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
}
}