refactor: use markdown layouts
All checks were successful
Deploy to SFTP Server / build (push) Successful in 6m11s
All checks were successful
Deploy to SFTP Server / build (push) Successful in 6m11s
This commit is contained in:
@ -16,14 +16,24 @@ function translatePath(lang: string) {
|
||||
return `/${[lang, ...split].join("/")}`;
|
||||
}
|
||||
|
||||
const flags = {
|
||||
de: "🇩🇪",
|
||||
en: "🇬🇧",
|
||||
};
|
||||
|
||||
const t = useTranslations(Astro.url);
|
||||
---
|
||||
|
||||
<ul>
|
||||
<ul class="flex items-center gap-4">
|
||||
{
|
||||
Object.entries(locales).map(([lang, label]) => (
|
||||
<li>
|
||||
<a href={translatePath(lang)} data-astro-prefetch>
|
||||
<a
|
||||
class="flex gap-2 items-center"
|
||||
href={translatePath(lang)}
|
||||
data-astro-prefetch
|
||||
>
|
||||
<span class="text-xs">{flags[label as keyof typeof flags]}</span>
|
||||
{t(label as "de")}
|
||||
</a>
|
||||
</li>
|
||||
|
Reference in New Issue
Block a user