--- import { allLocales, defaultLocale, themeConfig } from '@/config' import { ui } from '@/i18n/ui' import { getPageInfo } from '@/utils/page' import { ClientRouter } from 'astro:transitions' interface Props { postTitle?: string postDescription?: string postSlug?: string } const { postTitle, postDescription, postSlug } = Astro.props const { currentLang } = getPageInfo(Astro.url.pathname) const currentUI = ui[currentLang as keyof typeof ui] const langCode = currentLang === defaultLocale ? '' : `/${currentLang}` const { title, subtitle, description, author, url, favicon, i18nTitle } = themeConfig.site const { mode, light: { background: lightMode }, dark: { background: darkMode } } = themeConfig.color const { verification = {}, twitterID = '', googleAnalyticsID = '', umamiAnalyticsID = '', apiflashKey = '' } = themeConfig.seo ?? {} const { google = '', bing = '', yandex = '', baidu = '' } = verification const { commentURL = '', imageHostURL = '', customGoogleAnalyticsJS = '', customUmamiAnalyticsJS = '' } = themeConfig.preload const initMetaTheme = mode === 'dark' ? darkMode : lightMode 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` : apiflashKey ? `https://api.apiflash.com/v1/urltoimage?access_key=${apiflashKey}&url=${url}${langCode}&format=png&width=1500&height=788&ttl=86400&wait_until=network_idle&no_tracking=true` : `https://api.apiflash.com/v1/urltoimage?access_key=02a837b6188f4ba0a7fd9fbeff03a83e&url=https://retypeset.radishzz.cc${langCode}&format=png&width=1500&height=788&ttl=604800&wait_until=network_idle&no_tracking=true` --- {favicon.toLowerCase().endsWith('.svg') && } {favicon.toLowerCase().endsWith('.png') && } {favicon.toLowerCase().endsWith('.ico') && } {pageTitle} {commentURL && } {commentURL && } {imageHostURL && } {imageHostURL && } {allLocales.map(lang => ( ))} {twitterID && } {twitterID && } {google && } {bing && } {yandex && } {baidu && } {googleAnalyticsID && ( <> )} {umamiAnalyticsID && (