feat: enhance SSR support with language extraction, dynamic page titles, and updated styles; adjust color theme

This commit is contained in:
2026-02-26 11:09:42 +00:00
parent 40ffa8207e
commit 965a505e15
8 changed files with 85 additions and 37 deletions

View File

@@ -164,6 +164,12 @@ const { ssrRequest } = require("../lib/ssr-server")
}
var tpl = context.fs.readFile("templates/spa.html")
// Extract language from URL for <html lang="..."> (before other replacements)
var langMatch = url.match(/^\/(de|en)(\/|$)/)
var pageLang = langMatch ? langMatch[1] : "de"
tpl = tpl.replace(/<html lang="[^"]*">/, '<html lang="' + pageLang + '">')
tpl = tpl.replace("<!--HEAD-->", head)
tpl = tpl.replace("<!--HTML-->", html)
tpl = tpl.replace("<!--SSR.ERROR-->", error ? "<!--" + error + "-->" : "")

View File

@@ -1 +1 @@
frontend/spa.html
../../frontend/spa.html