mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-17 20:01:33 +02:00
fix: og url error
This commit is contained in:
parent
c97e3d5882
commit
66d055f512
2 changed files with 4 additions and 3 deletions
|
@ -8,7 +8,7 @@ export const themeConfig: ThemeConfig = {
|
||||||
// site subtitle (optional)
|
// site subtitle (optional)
|
||||||
subtitle: '再现版式之美',
|
subtitle: '再现版式之美',
|
||||||
// site description for SEO
|
// 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 name
|
||||||
author: 'radishzz',
|
author: 'radishzz',
|
||||||
// site url
|
// site url
|
||||||
|
|
|
@ -31,9 +31,10 @@ const pathParts = currentPath.split('/').filter(part => part !== '')
|
||||||
const slug = pathParts.length > 0 ? pathParts[pathParts.length - 1] : ''
|
const slug = pathParts.length > 0 ? pathParts[pathParts.length - 1] : ''
|
||||||
|
|
||||||
// Prioritize auto-generated OG image, otherwise use fallback OG image
|
// 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>
|
<head>
|
||||||
<!-- Basic info -->
|
<!-- Basic info -->
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue