Start updating paraglide to v2

This commit is contained in:
2025-07-01 20:51:59 +02:00
parent 5e7100c1e2
commit 7030f70b50
12 changed files with 52 additions and 948 deletions

View File

@ -1,8 +1,9 @@
---
import { type NavLink, resolvePathname } from "@/utils/linking"
import { type NavLink } from "@/utils/linking"
import LocaleLink from "@/components/links/LocaleLink.astro"
import { deLocalizeHref } from "@/paraglide/runtime.js"
const pathname = resolvePathname(Astro.originPathname)
const pathname = deLocalizeHref(Astro.originPathname)
let paths: string[]
if (pathname === "/") {
@ -25,13 +26,13 @@ function getLink(path: string): NavLink {
{
paths.map((path, index) => (
<span>
{index != paths.length - 1 ? (
{ index != paths.length - 1 ? (
<span>
<LocaleLink to={getLink(path)}>{path}</LocaleLink>/
<LocaleLink to={ getLink(path) }>{ path }</LocaleLink>/
</span>
) : (
path
)}
) }
</span>
))
}