mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-16 19:51:07 +02:00
✨ feat: i18n support for header, subtitle and about pages
This commit is contained in:
parent
22dc899a95
commit
96a89ddcd5
13 changed files with 103 additions and 30 deletions
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
import { allLocales, defaultLocale } from '@/config'
|
||||
import Layout from '@/layouts/Layout.astro'
|
||||
import { getCollection } from 'astro:content'
|
||||
|
||||
export async function getStaticPaths() {
|
||||
type PathItem = {
|
||||
|
@ -30,17 +31,16 @@ export async function getStaticPaths() {
|
|||
}
|
||||
|
||||
const { lang } = Astro.props
|
||||
|
||||
const allAboutEntries = await getCollection('about')
|
||||
const aboutEntry = allAboutEntries.find(entry => entry.data.lang === lang)
|
||||
|| allAboutEntries.find(entry => entry.data.lang === '')
|
||||
const { Content } = aboutEntry ? await aboutEntry.render() : { Content: null }
|
||||
---
|
||||
|
||||
<Layout>
|
||||
<div class="uno-decorative-line"></div>
|
||||
<div class="heti mt-4.375">
|
||||
{lang === 'en'
|
||||
? (
|
||||
<p>Retypeset is a static blog theme based on the <a href="https://astro.build/">Astro</a> framework, inspired by <a href="https://astro-theme-typography.vercel.app/">Typography</a>. Retypeset establishes a new visual standard and reimagines the layout of all pages, offering a reading experience similar to paper books, reviving the beauty of typography. Details in every sight, elegance in every space.</p>
|
||||
)
|
||||
: (
|
||||
<p>Retypeset 是一款基于<a href="https://astro.build/">Astro</a>框架的静态博客主题,设计灵感来自<a href="https://astro-theme-typography.vercel.app/">Typography</a>。本主题通过建立全新的视觉规范,对所有页面进行重新编排,打造纸质书页般的阅读体验,再现版式之美。所见皆为细节,方寸尽显优雅。</p>
|
||||
)}
|
||||
{Content && <Content />}
|
||||
</div>
|
||||
</Layout>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue