chore: update theme intro and i18n meta tag

This commit is contained in:
radishzzz 2025-03-15 22:23:55 +00:00
parent 26a3cce66e
commit e23f8bee96
5 changed files with 27 additions and 15 deletions

1
.gitattributes vendored
View file

@ -1 +0,0 @@
*.mdx linguist-detectable=false

View file

@ -21,8 +21,14 @@
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.
- [Live Demo](https://retypeset.radishzz.cc/)
- [Mobile design](https://mastergo.com/file/151079538766773?fileOpenFrom=home&page_id=M&source=link_share&shareId=151079538766773)
## Demo
- [Retypeset](https://retypeset.radishzz.cc/en/)
- [Retipografía](https://retypeset.radishzz.cc/en/)
- [Переверстка](https://retypeset.radishzz.cc/en/)
- [重新编排](https://retypeset.radishzz.cc/en/)
- [重新編排](https://retypeset.radishzz.cc/en/)
- [再組版](https://retypeset.radishzz.cc/en/)
## Features

View file

@ -21,8 +21,14 @@
Retypeset 是一款基于 [Astro](https://astro.build/) 框架的静态博客主题,设计灵感来自 [Typography](https://astro-theme-typography.vercel.app/)。本主题通过建立全新的视觉规范,对所有页面进行重新编排,打造纸质书页般的阅读体验,再现版式之美。所见皆为细节,方寸尽显优雅。
- [在线预览](https://retypeset.radishzz.cc/)
- [移动端设计稿](https://mastergo.com/file/151079538766773?fileOpenFrom=home&page_id=M&source=link_share&shareId=151079538766773)
## 预览
- [重新编排](https://retypeset.radishzz.cc/en/)
- [重新編排](https://retypeset.radishzz.cc/en/)
- [再組版](https://retypeset.radishzz.cc/en/)
- [Retypeset](https://retypeset.radishzz.cc/en/)
- [Retipografía](https://retypeset.radishzz.cc/en/)
- [Переверстка](https://retypeset.radishzz.cc/en/)
## 特征

View file

@ -6,7 +6,7 @@ export const themeConfig: ThemeConfig = {
// site title
title: 'Retypeset',
// site subtitle
subtitle: '再现版式之美',
subtitle: 'Revive the beauty of typography',
// use i18n title/subtitle from src/i18n/ui.ts instead of static ones above
i18nTitle: true,
// site description

View file

@ -1,5 +1,7 @@
---
import { allLocales, defaultLocale, themeConfig } from '@/config'
import { ui } from '@/i18n/ui'
import { getPageInfo } from '@/utils/page'
import { ClientRouter } from 'astro:transitions'
interface Props {
@ -9,16 +11,19 @@ interface Props {
}
const { postTitle, postDescription, postSlug } = Astro.props
const { currentLang } = getPageInfo(Astro.url.pathname)
const currentUI = ui[currentLang as keyof typeof ui]
const { title, subtitle, description, author, url, favicon } = themeConfig.site
const { title, subtitle, description, author, url, favicon, i18nTitle } = themeConfig.site
const { mode, light: { background: lightMode }, dark: { background: darkMode } } = themeConfig.color
// const { locale, moreLocales } = themeConfig.global
const { verification = {}, twitterID = '', googleAnalyticsID = '', umamiAnalyticsID = '' } = themeConfig.seo ?? {}
const { google = '', bing = '', yandex = '', baidu = '' } = verification
const { commentURL = '', imageHostURL = '', customGoogleAnalyticsJS = '', customUmamiAnalyticsJS = '' } = themeConfig.preload
const initMetaTheme = mode === 'dark' ? darkMode : lightMode
const pageTitle = postTitle ? `${postTitle} | ${title}` : `${title} - ${subtitle}`
const headTitle = i18nTitle ? currentUI.title : title
const headSubtitle = i18nTitle ? currentUI.subtitle : subtitle
const pageTitle = postTitle ? `${postTitle} | ${headTitle}` : `${headTitle} - ${headSubtitle}`
const pageDescription = postDescription || description
// TODO: Change openGraph image fallback url
const pageImage = postSlug ? `${url}/opengraph/${postSlug}.png` : 'https://placehold.co/1200x630'
@ -69,12 +74,8 @@ const pageImage = postSlug ? `${url}/opengraph/${postSlug}.png` : 'https://place
<meta name="twitter:title" content={pageTitle} />
<meta name="twitter:description" content={pageDescription} />
<meta name="twitter:image" content={pageImage} />
{twitterID && (
<>
<meta name="twitter:site" content={twitterID} />
<meta name="twitter:creator" content={twitterID} />
</>
)}
{twitterID && <meta name="twitter:site" content={twitterID} />}
{twitterID && <meta name="twitter:creator" content={twitterID} />}
<!-- Site Verification -->
{google && <meta name="google-site-verification" content={google} />}