SanYeCao-blog/src/pages/[lang]/index.astro

23 lines
605 B
Text
Raw Normal View History

2026-03-24 22:28:23 +00:00
---
import BaseLayout from "@/layouts/BaseLayout.astro";
import PostList from "@/components/Posts/PostList.astro";
2026-03-24 23:13:44 +00:00
import { getLangFromUrl, getTranslations } from "@/i18n";
2026-03-24 22:28:23 +00:00
import "@/styles/global.css";
export function getStaticPaths() {
return [{ params: { lang: "zh" } }, { params: { lang: "en" } }];
}
2026-03-24 23:13:44 +00:00
const lang = getLangFromUrl(Astro.url);
const t = getTranslations(lang);
const pageTitle = t.home.title;
2026-03-24 22:28:23 +00:00
---
<BaseLayout pageTitle={pageTitle}>
2026-03-24 23:13:44 +00:00
<h1>{pageTitle}</h1>
<div class="content">
{t.home.content.map((line: string) => <p set:html={line} />)}
</div>
2026-03-24 22:28:23 +00:00
<PostList />
</BaseLayout>