Update Head.tsx

This commit is contained in:
enneaa 2025-03-13 04:04:31 +08:00 committed by GitHub
parent 6ef273ce39
commit 1bd6b2bf5e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -135,7 +135,7 @@ export default (() => {
const path = url.pathname as FullSlug 
const baseDir = fileData.slug === "404" ? path : pathToRoot(fileData.slug!)
const iconPath = joinSegments(baseDir, "static/icon.png") 
const iconPath = joinSegments(baseDir, "static/icon.png")  
const ogImageDefaultPath = `https://${cfg.baseUrl}/static/og-image.png`
// "static/social-images/slug-filename.md.webp"
@ -172,19 +172,19 @@ export default (() => {
<head>
<title>{title}</title>
<meta charSet="utf-8" /> 
{cfg.theme.cdnCaching && cfg.theme.fontOrigin === "local" && (
{cfg.theme.cdnCaching && cfg.theme.fontOrigin === "local" ? ( 
<>
<link rel="preconnect" href="https://cdn.staticfile.org" />
<link rel="stylesheet" href="https://cdn.staticfile.org/lxgw-wenkai-webfont/1.7.0/style.css" />
<link rel="stylesheet" href="https://cdn.staticfile.org/lxgw-wenkai-webfont/1.7.0/style.css" /> 
</>
{cfg.theme.cdnCaching && cfg.theme.fontOrigin === "googleFonts" && (  
) : cfg.theme.fontOrigin === "googleFonts" && (   
<>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link rel="preconnect" href="https://fonts.googleapis.com" /> 
<link rel="preconnect" href="https://fonts.gstatic.com" /> 
<link rel="stylesheet" href={googleFontHref(cfg.theme)} />
</>
)}
<link rel="preconnect" href="https://cdnjs.cloudflare.com" crossOrigin="anonymous" />
<link rel="preconnect" href="https://cdnjs.cloudflare.com" crossOrigin="anonymous" /> 
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
{/* OG/Twitter meta tags */}
<meta name="og:site_name" content={cfg.pageTitle}></meta>