feat: i18n support for header, subtitle and about pages

This commit is contained in:
radishzzz 2025-03-15 02:52:23 +00:00
parent 22dc899a95
commit 96a89ddcd5
13 changed files with 103 additions and 30 deletions

View file

@ -0,0 +1,5 @@
---
lang: en
---
Retypeset is a static blog theme based on the [Astro](https://astro.build/) framework, inspired by [Typography](https://astro-theme-typography.vercel.app/). 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.

View file

@ -0,0 +1,5 @@
---
lang: es
---
Retypeset es un tema de blog estático basado en el framework [Astro](https://astro.build/), inspirado en [Typography](https://astro-theme-typography.vercel.app/). Retypeset establece un nuevo estándar visual y reimagina la disposición de todas las páginas, ofreciendo una experiencia de lectura similar a la de los libros impresos, reviviendo la belleza de la tipografía. Detalles en cada mirada, elegancia en cada espacio.

View file

@ -0,0 +1,5 @@
---
lang: ja
---
Retypeset は [Astro](https://astro.build/) フレームワークをベースにした静的ブログテーマで、[Typography](https://astro-theme-typography.vercel.app/) からインスピレーションを得ています。新しい視覚的標準を確立し、すべてのページのレイアウトを再考することで、紙の本のような読書体験を提供し、タイポグラフィの美しさを蘇らせます。細部へのこだわりと、洗練された空間デザインが特徴です。

View file

@ -0,0 +1,5 @@
---
lang: ru
---
Retypeset — это статическая тема блога, основанная на фреймворке [Astro](https://astro.build/) и вдохновленная [Typography](https://astro-theme-typography.vercel.app/). Retypeset устанавливает новый визуальный стандарт и переосмысливает компоновку всех страниц, предлагая опыт чтения, подобный бумажным книгам, возрождая красоту типографики. Детали в каждом взгляде, элегантность в каждом пространстве.

View file

@ -0,0 +1,5 @@
---
lang: zh-tw
---
Retypeset 是一款基於 [Astro](https://astro.build/) 框架的靜態博客主題,設計靈感來自 [Typography](https://astro-theme-typography.vercel.app/)。本主題通過建立全新的視覺規範,對所有頁面進行重新編排,打造紙質書頁般的閱讀體驗,再現版式之美。所見皆為細節,方寸盡顯優雅。

View file

@ -0,0 +1,5 @@
---
lang: zh
---
Retypeset 是一款基于 [Astro](https://astro.build/) 框架的静态博客主题,设计灵感来自 [Typography](https://astro-theme-typography.vercel.app/)。本主题通过建立全新的视觉规范,对所有页面进行重新编排,打造纸质书页般的阅读体验,再现版式之美。所见皆为细节,方寸尽显优雅。

View file

@ -1,3 +1,4 @@
import { allLocales } from '@/config'
import { defineCollection, z } from 'astro:content'
const postsCollection = defineCollection({
@ -13,7 +14,7 @@ const postsCollection = defineCollection({
draft: z.boolean().optional().default(false),
pin: z.number().int().min(0).max(99).optional().default(0),
toc: z.boolean().optional().default(false),
lang: z.string().optional().default(''),
lang: z.enum(['', ...allLocales]).optional().default(''),
abbrlink: z.string().optional().default('').refine(
abbrlink => !abbrlink || /^[a-z0-9\-]*$/.test(abbrlink),
{ message: 'Abbrlink can only contain lowercase letters, numbers and hyphens' },
@ -21,6 +22,13 @@ const postsCollection = defineCollection({
}),
})
const aboutCollection = defineCollection({
schema: z.object({
lang: z.enum(['', ...allLocales]).optional().default(''),
}),
})
export const collections = {
posts: postsCollection,
about: aboutCollection,
}