fix(translations): stay on page
release.yaml / publish (push) Successful in 4m0s

This commit is contained in:
schreifuchs committed 2026-09-28 09:52:22 +02:00
1 parent c08dd355c0
commit 297efaa4a6
3 files changed
+45 -24

No files matched your search

+36 -23
View File
@@ -7,7 +7,7 @@ import (
"strings"
)
templ Head(cfg config.Cfg, title string) {
templ head(cfg config.Cfg, title string) {
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
@@ -29,29 +29,42 @@ templ Head(cfg config.Cfg, title string) {
templ Base(cfg config.Cfg, title string) {
<!DOCTYPE html>
<html lang={ translate.Language(ctx) }>
@Head(cfg, title)
<body class="bg-black dark" hx-boost="true" hx-target="main" hx-ext="head-support,preload,preload-links">
<header
class="fixed z-50 mix-blend-difference p-1 w-full flex justify-between items-start"
>
<a class="text-white text-2xl" href={ translate.Path(ctx, "") } preload="mouseover" preload-images="true">schreifuchs.ch</a>
<nav class="flex gap-2 p-2">
for _, lang := range translate.SupportedLanguages(ctx) {
<a
href={ translate.PathForLang(ctx, lang, strings.Split(templer.Path(ctx), "/")...) }
hreflang={ lang }
data-no-translate
preload="mouseover"
class="text-white hover:underline uppercase"
>
{ lang }
</a>
}
</nav>
</header>
<main class="text-white">
@head(cfg, title)
<body class="bg-black dark" hx-boost="true" hx-target="body" hx-ext="head-support,preload,preload-links">
@body() {
{ children... }
</main>
}
</body>
</html>
}
templ Content(cfg config.Cfg, title string) {
@head(cfg, title)
@body() {
{ children... }
}
}
templ body() {
<header
class="fixed z-50 mix-blend-difference p-1 w-full flex justify-between items-start"
>
<a class="text-white text-2xl" href={ translate.Path(ctx, "") } preload="mouseover" preload-images="true">schreifuchs.ch</a>
<nav class="flex gap-2 p-2">
for _, lang := range translate.SupportedLanguages(ctx) {
<a
href={ translate.PathForLang(ctx, lang, strings.Split(templer.Path(ctx), "/")...) }
hreflang={ lang }
data-no-translate
preload="mouseover"
class="text-white hover:underline uppercase"
>
{ lang }
</a>
}
</nav>
</header>
<main class="text-white">
{ children... }
</main>
}