mirror of
https://github.com/kogakure/website-astro-stefanimhoff.de.git
synced 2026-02-03 12:05:28 +00:00
feat: add new OG image design
This commit is contained in:
committed by
Stefan Imhoff
parent
b49b0f95fc
commit
61c722c84f
@@ -33,13 +33,18 @@ const {
|
||||
cover = '/assets/images/branding/og/bonsai.jpg',
|
||||
} = Astro.props;
|
||||
|
||||
const processedCover = cover.endsWith('.webp') ? cover.replace(/\.webp$/, '.jpg') : cover;
|
||||
const ogImage =
|
||||
cover.startsWith('/assets/images/cover/') && cover.endsWith('.webp')
|
||||
? cover
|
||||
.replace('/assets/images/cover/', '/assets/images/branding/og/')
|
||||
.replace(/\.webp$/, '.jpg')
|
||||
: cover;
|
||||
|
||||
const currentPath = new URL(Astro.request.url).pathname;
|
||||
const fullTitle = `${title} · ${site.description}`;
|
||||
const fullDescription = description || site.description;
|
||||
const fullUrl = site.url + currentPath;
|
||||
const fullImage = site.url + processedCover;
|
||||
const fullImage = site.url + ogImage;
|
||||
|
||||
const schema = JSON.stringify({
|
||||
'@context': 'https://schema.org/',
|
||||
|
||||
Reference in New Issue
Block a user