diff --git a/astro.config.mjs b/astro.config.mjs index 7b5a8e9..cb817e9 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -12,5 +12,8 @@ export default defineConfig({ }, }, }, - site: "https://blog.cloverta.top" + site: "https://blog.cloverta.top", + redirects: { + "/": "/zh", + }, }) diff --git a/src/components/ThemeIcon.astro b/src/components/ThemeIcon.astro index 4ecb7e7..259635e 100644 --- a/src/components/ThemeIcon.astro +++ b/src/components/ThemeIcon.astro @@ -103,34 +103,38 @@ const switchHref = "/" + segments.join("/"); diff --git a/src/i18n/en.ts b/src/i18n/en.ts index ff42ee3..fbda9ad 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -19,7 +19,7 @@ export default { }, langSwitcher: "δΈ­ζ–‡", home: { - title: "Welcome in β€” mind the turn to the left", + title: "Welcome in β€” please mind the gap", content: [ "These few lines speak what the heart would say; Ink and paper end, but thoughts still stay", "Welcome to Cloverta's blog.", diff --git a/src/layouts/MarkdownPostLayout.astro b/src/layouts/MarkdownPostLayout.astro index a24919a..73aae16 100644 --- a/src/layouts/MarkdownPostLayout.astro +++ b/src/layouts/MarkdownPostLayout.astro @@ -1,47 +1,142 @@ --- import BaseLayout from "./BaseLayout.astro"; import Giscus from "@/components/Giscus.astro"; +import { getLangFromUrl, getTranslations } from "@/i18n"; import "@/styles/global.css"; + const { frontmatter } = Astro.props; +const lang = getLangFromUrl(Astro.url); +const t = getTranslations(lang); --- -

{frontmatter.title}

-

{frontmatter.pubDate.toLocaleDateString()}

-

{frontmatter.description}

-

Written by: {frontmatter.author}

- {frontmatter.image.alt} +
+ +