diff --git a/site/src/layouts/Base.astro b/site/src/layouts/Base.astro new file mode 100644 index 0000000..0840c02 --- /dev/null +++ b/site/src/layouts/Base.astro @@ -0,0 +1,72 @@ +--- +import "../styles/theme.css"; +import { defaultLocale, type Locale } from "../i18n/ui"; + +interface Props { + title: string; + description: string; + locale?: Locale; + /** Path WITHOUT locale prefix, e.g. "/install". "/" for home. */ + path: string; +} + +const { title, description, locale = defaultLocale, path } = Astro.props; +const site = "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"]; +--- + + + + + + + {title} + + + + + {locales.map((l) => ( + + ))} + + + + + + + + + + + + + + + + + + + + + + + + + + + + +