From a1da3f9a5eafa01d35a06fa3d0231dcc0150f9a5 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Thu, 29 Feb 2024 19:54:03 +0300 Subject: [PATCH] Visual update for language switch --- data/home/content/index.md | 4 ++++ src/main/kotlin/center/sciprog/spcMisc.kt | 11 +++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 data/home/content/index.md diff --git a/data/home/content/index.md b/data/home/content/index.md new file mode 100644 index 0000000..d0fe2e7 --- /dev/null +++ b/data/home/content/index.md @@ -0,0 +1,4 @@ +--- +pageName: SPC +language: en +--- \ No newline at end of file diff --git a/src/main/kotlin/center/sciprog/spcMisc.kt b/src/main/kotlin/center/sciprog/spcMisc.kt index 4732aef..db7f2ce 100644 --- a/src/main/kotlin/center/sciprog/spcMisc.kt +++ b/src/main/kotlin/center/sciprog/spcMisc.kt @@ -169,10 +169,13 @@ internal fun wrapper(contentBody: FlowContent.() -> Unit) = postprocess { languageMap.takeIf { it.size > 1 }?.let { languageMap -> div { - languageMap.forEach { (key, meta) -> - a(classes = "button primary small") { -// val pageUrl = URLBuilder(host).appendPathSegments(meta.string ?: "#") -// href = pageUrl.buildString().removeSuffix("/") //resolveRef(meta.string ?: "#") + languageMap.entries.forEachIndexed { index, (key, meta) -> + if (index != 0) { + a { + +"/" + } + } + a { href = page.resolvePageRef(meta.string ?: "#", site.parent!!) +key }