mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
feat(landing): move language switcher from navbar to footer (#513)
This commit is contained in:
@@ -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.
|
// biome-ignore-all lint/correctness/noUnusedVariables: Astro template consumes frontmatter values.
|
||||||
|
import LanguageSwitcher from "@/components/LanguageSwitcher.astro";
|
||||||
import { t } from "@/i18n";
|
import { t } from "@/i18n";
|
||||||
import { localizeHref } from "@/lib/i18n-page";
|
import { localizeHref } from "@/lib/i18n-page";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
locale?: string;
|
locale?: string;
|
||||||
|
path?: string;
|
||||||
}
|
}
|
||||||
const { locale = "en" } = Astro.props;
|
const { locale = "en", path = "/" } = Astro.props;
|
||||||
|
|
||||||
const year = new Date().getFullYear();
|
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>
|
<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>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="mt-4">
|
||||||
|
<LanguageSwitcher locale={locale} path={path} />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Link columns -->
|
<!-- Link columns -->
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ const options = LANDING_LOCALES.map((code) => ({
|
|||||||
<span>{nativeName(locale)}</span>
|
<span>{nativeName(locale)}</span>
|
||||||
</button>
|
</button>
|
||||||
<ul
|
<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"
|
role="listbox"
|
||||||
data-switcher-menu
|
data-switcher-menu
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,15 +1,13 @@
|
|||||||
---
|
---
|
||||||
// biome-ignore-all lint/correctness/noUnusedVariables: Astro template consumes frontmatter values.
|
// biome-ignore-all lint/correctness/noUnusedVariables: Astro template consumes frontmatter values.
|
||||||
import LanguageSwitcher from "@/components/LanguageSwitcher.astro";
|
|
||||||
import { t } from "@/i18n";
|
import { t } from "@/i18n";
|
||||||
import { localizeHref } from "@/lib/i18n-page";
|
import { localizeHref } from "@/lib/i18n-page";
|
||||||
import { formatCompact, getStarCount } from "@/lib/stats";
|
import { formatCompact, getStarCount } from "@/lib/stats";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
locale?: string;
|
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.
|
// Fetched at build time; refreshed by the scheduled landing rebuild.
|
||||||
const starCount = formatCompact(await getStarCount());
|
const starCount = formatCompact(await getStarCount());
|
||||||
@@ -87,7 +85,6 @@ const links: NavItem[] = [
|
|||||||
|
|
||||||
<!-- Desktop CTAs -->
|
<!-- Desktop CTAs -->
|
||||||
<div class="hidden shrink-0 items-center gap-3 md:flex">
|
<div class="hidden shrink-0 items-center gap-3 md:flex">
|
||||||
<LanguageSwitcher locale={locale} path={path} />
|
|
||||||
<a
|
<a
|
||||||
href="https://github.com/snapotter-hq/snapotter"
|
href="https://github.com/snapotter-hq/snapotter"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ const allJsonLd = [breadcrumbJsonLd, ...(faqJsonLd ? [faqJsonLd] : [])];
|
|||||||
<JsonLd data={allJsonLd} />
|
<JsonLd data={allJsonLd} />
|
||||||
</Fragment>
|
</Fragment>
|
||||||
|
|
||||||
<Navbar locale={locale} path={PATH} />
|
<Navbar locale={locale} />
|
||||||
|
|
||||||
<main id="main">
|
<main id="main">
|
||||||
<!-- Breadcrumb -->
|
<!-- Breadcrumb -->
|
||||||
@@ -336,5 +336,5 @@ const allJsonLd = [breadcrumbJsonLd, ...(faqJsonLd ? [faqJsonLd] : [])];
|
|||||||
<EnterpriseCtaBand />
|
<EnterpriseCtaBand />
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<Footer locale={locale} />
|
<Footer locale={locale} path={PATH} />
|
||||||
</Base>
|
</Base>
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ const formatReviewDate = (date: string) =>
|
|||||||
<JsonLd data={allJsonLd} />
|
<JsonLd data={allJsonLd} />
|
||||||
</Fragment>
|
</Fragment>
|
||||||
|
|
||||||
<Navbar locale={locale} path={PATH} />
|
<Navbar locale={locale} />
|
||||||
|
|
||||||
<main id="main">
|
<main id="main">
|
||||||
<!-- Hero -->
|
<!-- Hero -->
|
||||||
@@ -216,5 +216,5 @@ const formatReviewDate = (date: string) =>
|
|||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<Footer locale={locale} />
|
<Footer locale={locale} path={PATH} />
|
||||||
</Base>
|
</Base>
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ const subjects = [
|
|||||||
<JsonLd data={breadcrumbJsonLd} />
|
<JsonLd data={breadcrumbJsonLd} />
|
||||||
</Fragment>
|
</Fragment>
|
||||||
|
|
||||||
<Navbar locale={locale} path={PATH} />
|
<Navbar locale={locale} />
|
||||||
|
|
||||||
<main id="main" class="px-6 pt-32 pb-20 md:pt-40 md:pb-28">
|
<main id="main" class="px-6 pt-32 pb-20 md:pt-40 md:pb-28">
|
||||||
<div class="mx-auto grid max-w-5xl gap-16 md:grid-cols-2">
|
<div class="mx-auto grid max-w-5xl gap-16 md:grid-cols-2">
|
||||||
@@ -139,5 +139,5 @@ const subjects = [
|
|||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<Footer locale={locale} />
|
<Footer locale={locale} path={PATH} />
|
||||||
</Base>
|
</Base>
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ const xSvg =
|
|||||||
<JsonLd data={[breadcrumbJsonLd, productJsonLd]} />
|
<JsonLd data={[breadcrumbJsonLd, productJsonLd]} />
|
||||||
</Fragment>
|
</Fragment>
|
||||||
|
|
||||||
<Navbar locale={locale} path={PATH} />
|
<Navbar locale={locale} />
|
||||||
|
|
||||||
<main id="main">
|
<main id="main">
|
||||||
|
|
||||||
@@ -456,5 +456,5 @@ const xSvg =
|
|||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<Footer locale={locale} />
|
<Footer locale={locale} path={PATH} />
|
||||||
</Base>
|
</Base>
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ const breadcrumbJsonLd = {
|
|||||||
<JsonLd data={[faqJsonLd, breadcrumbJsonLd]} />
|
<JsonLd data={[faqJsonLd, breadcrumbJsonLd]} />
|
||||||
</Fragment>
|
</Fragment>
|
||||||
|
|
||||||
<Navbar locale={locale} path={PATH} />
|
<Navbar locale={locale} />
|
||||||
|
|
||||||
<main id="main" class="px-6 pt-32 pb-20 md:pt-40 md:pb-28">
|
<main id="main" class="px-6 pt-32 pb-20 md:pt-40 md:pb-28">
|
||||||
<div class="mx-auto max-w-3xl">
|
<div class="mx-auto max-w-3xl">
|
||||||
@@ -109,5 +109,5 @@ const breadcrumbJsonLd = {
|
|||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<Footer locale={locale} />
|
<Footer locale={locale} path={PATH} />
|
||||||
</Base>
|
</Base>
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ const navSchema = {
|
|||||||
<JsonLd data={[websiteSchema, softwareSchema, navSchema]} />
|
<JsonLd data={[websiteSchema, softwareSchema, navSchema]} />
|
||||||
</Fragment>
|
</Fragment>
|
||||||
|
|
||||||
<Navbar locale={locale} path={PATH} />
|
<Navbar locale={locale} />
|
||||||
|
|
||||||
<main id="main">
|
<main id="main">
|
||||||
<Hero locale={locale} />
|
<Hero locale={locale} />
|
||||||
@@ -137,5 +137,5 @@ const navSchema = {
|
|||||||
<OpenSource locale={locale} />
|
<OpenSource locale={locale} />
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<Footer locale={locale} />
|
<Footer locale={locale} path={PATH} />
|
||||||
</Base>
|
</Base>
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ const breadcrumbJsonLd = {
|
|||||||
<JsonLd data={breadcrumbJsonLd} />
|
<JsonLd data={breadcrumbJsonLd} />
|
||||||
</Fragment>
|
</Fragment>
|
||||||
|
|
||||||
<Navbar locale={locale} path={PATH} />
|
<Navbar locale={locale} />
|
||||||
|
|
||||||
<main id="main" class="px-6 pt-32 pb-20 md:pt-40 md:pb-28">
|
<main id="main" class="px-6 pt-32 pb-20 md:pt-40 md:pb-28">
|
||||||
<div class="mx-auto max-w-3xl">
|
<div class="mx-auto max-w-3xl">
|
||||||
@@ -141,5 +141,5 @@ const breadcrumbJsonLd = {
|
|||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<Footer locale={locale} />
|
<Footer locale={locale} path={PATH} />
|
||||||
</Base>
|
</Base>
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ const breadcrumbJsonLd = {
|
|||||||
<JsonLd data={breadcrumbJsonLd} />
|
<JsonLd data={breadcrumbJsonLd} />
|
||||||
</Fragment>
|
</Fragment>
|
||||||
|
|
||||||
<Navbar locale={locale} path={PATH} />
|
<Navbar locale={locale} />
|
||||||
|
|
||||||
<main id="main" class="px-6 pt-32 pb-20 md:pt-40 md:pb-28">
|
<main id="main" class="px-6 pt-32 pb-20 md:pt-40 md:pb-28">
|
||||||
<div class="mx-auto max-w-3xl">
|
<div class="mx-auto max-w-3xl">
|
||||||
@@ -144,5 +144,5 @@ const breadcrumbJsonLd = {
|
|||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<Footer locale={locale} />
|
<Footer locale={locale} path={PATH} />
|
||||||
</Base>
|
</Base>
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ const toolDesc = (id: string, fallback: string) => toolStrings[id]?.description
|
|||||||
locale={locale}
|
locale={locale}
|
||||||
path={PATH}
|
path={PATH}
|
||||||
>
|
>
|
||||||
<Navbar locale={locale} path={PATH} />
|
<Navbar locale={locale} />
|
||||||
|
|
||||||
<main id="main">
|
<main id="main">
|
||||||
<nav class="mx-auto max-w-6xl px-6 pt-28 md:pt-36" aria-label="Breadcrumb">
|
<nav class="mx-auto max-w-6xl px-6 pt-28 md:pt-36" aria-label="Breadcrumb">
|
||||||
@@ -120,5 +120,5 @@ const toolDesc = (id: string, fallback: string) => toolStrings[id]?.description
|
|||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<Footer locale={locale} />
|
<Footer locale={locale} path={PATH} />
|
||||||
</Base>
|
</Base>
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ const collectionJsonLd = {
|
|||||||
<JsonLd data={[breadcrumbJsonLd, collectionJsonLd]} />
|
<JsonLd data={[breadcrumbJsonLd, collectionJsonLd]} />
|
||||||
</Fragment>
|
</Fragment>
|
||||||
|
|
||||||
<Navbar locale={locale} path={PATH} />
|
<Navbar locale={locale} />
|
||||||
|
|
||||||
<main id="main">
|
<main id="main">
|
||||||
<!-- Breadcrumb -->
|
<!-- Breadcrumb -->
|
||||||
@@ -382,5 +382,5 @@ const collectionJsonLd = {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Footer locale={locale} />
|
<Footer locale={locale} path={PATH} />
|
||||||
</Base>
|
</Base>
|
||||||
|
|||||||
Reference in New Issue
Block a user