mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-16 11:41:17 +02:00
update: unified multilingual page styles
This commit is contained in:
parent
05d3a8034b
commit
91d27dd2ba
14 changed files with 118 additions and 85 deletions
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
import themeConfig from '@/config'
|
||||
import { allLocales, defaultLocale } from '@/i18n/config'
|
||||
import { ClientRouter } from 'astro:transitions'
|
||||
|
||||
interface Props {
|
||||
|
@ -12,7 +13,7 @@ const { postTitle, postDescription, postSlug } = Astro.props
|
|||
|
||||
const { title, subtitle, description, author, url, favicon } = themeConfig.site
|
||||
const { mode, light: { background: lightMode }, dark: { background: darkMode } } = themeConfig.color
|
||||
const { locale, moreLocale } = themeConfig.global
|
||||
// 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
|
||||
|
@ -48,10 +49,10 @@ const pageImage = postSlug ? `${url}/og/${postSlug}.png` : 'https://placehold.co
|
|||
<link rel="canonical" href={Astro.url} />
|
||||
|
||||
<!-- i18n hreflang generate -->
|
||||
{[locale, ...moreLocale].map(lang => (
|
||||
{allLocales.map(lang => (
|
||||
<link
|
||||
rel="alternate"
|
||||
href={`${url}${lang === locale ? '' : `/${lang}/`}`}
|
||||
href={`${url}${lang === defaultLocale ? '' : `/${lang}/`}`}
|
||||
hreflang={lang === 'zh-tw' ? 'zh-TW' : lang}
|
||||
/>
|
||||
))}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue