fix: og url error

This commit is contained in:
radishzzz 2025-03-13 00:29:24 +00:00
parent c97e3d5882
commit 66d055f512
2 changed files with 4 additions and 3 deletions

View file

@ -8,7 +8,7 @@ export const themeConfig: ThemeConfig = {
// site subtitle (optional)
subtitle: '再现版式之美',
// site description for SEO
description: 'Retypeset is a static blog theme based on the Astro framework, inspired by Typography 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.',
description: 'Retypeset is a static blog theme based on the Astro framework, inspired by Typography. 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.',
// author name
author: 'radishzz',
// site url

View file

@ -31,9 +31,10 @@ const pathParts = currentPath.split('/').filter(part => part !== '')
const slug = pathParts.length > 0 ? pathParts[pathParts.length - 1] : ''
// Prioritize auto-generated OG image, otherwise use fallback OG image
const pageImage = isPost && slug ? `${url}/og/${slug}` : favicon
const pageImage = isPost && slug
? `${url}/og/${slug}.png`
: (favicon.startsWith('http') ? favicon : `${url}${favicon}`)
---
<head>
<!-- Basic info -->
<meta charset="utf-8" />