mirror of
https://github.com/explosion/spaCy.git
synced 2025-05-03 15:23:41 +03:00
Fix broken social media image (#12137)
This commit is contained in:
parent
dec81508d2
commit
8a3ca77d9e
|
@ -9,6 +9,8 @@ import socialImageLegacy from '../images/social_legacy.jpg'
|
||||||
import siteMetadata from '../../meta/site.json'
|
import siteMetadata from '../../meta/site.json'
|
||||||
import Head from 'next/head'
|
import Head from 'next/head'
|
||||||
|
|
||||||
|
import { siteUrl } from '../../meta/dynamicMeta.mjs'
|
||||||
|
|
||||||
function getPageTitle(title, sitename, slogan, sectionTitle, nightly, legacy) {
|
function getPageTitle(title, sitename, slogan, sectionTitle, nightly, legacy) {
|
||||||
if (sectionTitle && title) {
|
if (sectionTitle && title) {
|
||||||
const suffix = nightly ? ' (nightly)' : legacy ? ' (legacy)' : ''
|
const suffix = nightly ? ' (nightly)' : legacy ? ' (legacy)' : ''
|
||||||
|
@ -25,7 +27,7 @@ function getImage(section, nightly, legacy) {
|
||||||
if (legacy) return socialImageLegacy
|
if (legacy) return socialImageLegacy
|
||||||
if (section === 'api') return socialImageApi
|
if (section === 'api') return socialImageApi
|
||||||
if (section === 'universe') return socialImageUniverse
|
if (section === 'universe') return socialImageUniverse
|
||||||
return socialImageDefault
|
return `${siteUrl}${socialImageDefault.src}`
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function SEO({
|
export default function SEO({
|
||||||
|
@ -46,7 +48,7 @@ export default function SEO({
|
||||||
nightly,
|
nightly,
|
||||||
legacy
|
legacy
|
||||||
)
|
)
|
||||||
const socialImage = getImage(section, nightly, legacy).src
|
const socialImage = getImage(section, nightly, legacy)
|
||||||
const meta = [
|
const meta = [
|
||||||
{
|
{
|
||||||
name: 'description',
|
name: 'description',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user