diff --git a/site/src/layouts/Base.astro b/site/src/layouts/Base.astro index 0840c02..9fd8ea7 100644 --- a/site/src/layouts/Base.astro +++ b/site/src/layouts/Base.astro @@ -1,6 +1,6 @@ --- import "../styles/theme.css"; -import { defaultLocale, type Locale } from "../i18n/ui"; +import { defaultLocale, locales, type Locale } from "../i18n/ui"; interface Props { title: string; @@ -11,11 +11,10 @@ interface Props { } const { title, description, locale = defaultLocale, path } = Astro.props; -const site = "https://termscp.rs"; +const site = Astro.site?.href ?? "https://termscp.rs/"; const localizedPath = locale === defaultLocale ? path : `/${locale}${path}`; const canonical = new URL(localizedPath, site).href; const ogImage = new URL("/assets/images/og_preview.jpg", site).href; -const locales: Locale[] = ["en", "zh-CN", "it", "fr", "es"]; --- @@ -35,6 +34,7 @@ const locales: Locale[] = ["en", "zh-CN", "it", "fr", "es"]; href={new URL(l === defaultLocale ? path : `/${l}${path}`, site).href} /> ))} + @@ -45,6 +45,13 @@ const locales: Locale[] = ["en", "zh-CN", "it", "fr", "es"]; + + + + + + + @@ -54,7 +61,7 @@ const locales: Locale[] = ["en", "zh-CN", "it", "fr", "es"]; - +