feat(landing): move language switcher from navbar to footer (#513)

This commit is contained in:
SnapOtter
2026-07-13 16:59:09 +08:00
committed by GitHub
parent ce54d06e79
commit 2dee9ead0b
13 changed files with 29 additions and 26 deletions
+7 -1
View File
@@ -1,12 +1,15 @@
---
// biome-ignore-all lint/correctness/noUnusedImports: Astro template consumes component imports.
// biome-ignore-all lint/correctness/noUnusedVariables: Astro template consumes frontmatter values.
import LanguageSwitcher from "@/components/LanguageSwitcher.astro";
import { t } from "@/i18n";
import { localizeHref } from "@/lib/i18n-page";
interface Props {
locale?: string;
path?: string;
}
const { locale = "en" } = Astro.props;
const { locale = "en", path = "/" } = Astro.props;
const year = new Date().getFullYear();
@@ -110,6 +113,9 @@ const columns = [
<svg class="h-4 w-4" viewBox="0 0 24 24" fill="currentColor"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>
</a>
</div>
<div class="mt-4">
<LanguageSwitcher locale={locale} path={path} />
</div>
</div>
<!-- Link columns -->
@@ -35,7 +35,7 @@ const options = LANDING_LOCALES.map((code) => ({
<span>{nativeName(locale)}</span>
</button>
<ul
class="absolute end-0 z-50 mt-2 hidden max-h-80 w-44 overflow-y-auto rounded-xl border border-border bg-surface py-1.5 text-sm shadow-xl"
class="absolute start-0 z-50 mt-2 hidden max-h-80 w-44 overflow-y-auto rounded-xl border border-border bg-surface py-1.5 text-sm shadow-xl"
role="listbox"
data-switcher-menu
>
+1 -4
View File
@@ -1,15 +1,13 @@
---
// biome-ignore-all lint/correctness/noUnusedVariables: Astro template consumes frontmatter values.
import LanguageSwitcher from "@/components/LanguageSwitcher.astro";
import { t } from "@/i18n";
import { localizeHref } from "@/lib/i18n-page";
import { formatCompact, getStarCount } from "@/lib/stats";
interface Props {
locale?: string;
path?: string;
}
const { locale = "en", path = "/" } = Astro.props;
const { locale = "en" } = Astro.props;
// Fetched at build time; refreshed by the scheduled landing rebuild.
const starCount = formatCompact(await getStarCount());
@@ -87,7 +85,6 @@ const links: NavItem[] = [
<!-- Desktop CTAs -->
<div class="hidden shrink-0 items-center gap-3 md:flex">
<LanguageSwitcher locale={locale} path={path} />
<a
href="https://github.com/snapotter-hq/snapotter"
target="_blank"