Fix broken social media image (#12137)

This commit is contained in:
Marcus Blättermann 2023-01-20 16:57:43 +01:00 committed by GitHub
parent dec81508d2
commit 8a3ca77d9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,6 +9,8 @@ import socialImageLegacy from '../images/social_legacy.jpg'
import siteMetadata from '../../meta/site.json'
import Head from 'next/head'
import { siteUrl } from '../../meta/dynamicMeta.mjs'
function getPageTitle(title, sitename, slogan, sectionTitle, nightly, legacy) {
if (sectionTitle && title) {
const suffix = nightly ? ' (nightly)' : legacy ? ' (legacy)' : ''
@ -25,7 +27,7 @@ function getImage(section, nightly, legacy) {
if (legacy) return socialImageLegacy
if (section === 'api') return socialImageApi
if (section === 'universe') return socialImageUniverse
return socialImageDefault
return `${siteUrl}${socialImageDefault.src}`
}
export default function SEO({
@ -46,7 +48,7 @@ export default function SEO({
nightly,
legacy
)
const socialImage = getImage(section, nightly, legacy).src
const socialImage = getImage(section, nightly, legacy)
const meta = [
{
name: 'description',