0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Added missing name attribute to "WebSite" metadata

refs https://developers.google.com/search/docs/appearance/site-names?hl=fr#website

The 'WebSite' type from https://schema.org should have a name attribute
on the root object. This value is used by Google Search for the name
display on to top of the content title.
This commit is contained in:
Ludovic Toinel 2024-10-25 09:40:45 +02:00 committed by GitHub
parent a9e69d3b0d
commit c8b05fdfa6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 21 additions and 0 deletions

View file

@ -119,6 +119,7 @@ function getHomeSchema(metaData) {
'@type': 'WebSite',
publisher: schemaPublisherObject(metaData),
url: metaData.url,
name: metaData.site.title,
image: schemaImageObject(metaData.coverImage),
mainEntityOfPage: metaData.url,
description: metaData.metaDescription ?

View file

@ -484,6 +484,7 @@ Object {
}
},
\\"url\\": \\"http://127.0.0.1:2369/\\",
\\"name\\": \\"Ghost\\",
\\"image\\": {
\\"@type\\": \\"ImageObject\\",
\\"url\\": \\"http://127.0.0.1:2369/content/images/site-cover.png\\"
@ -599,6 +600,7 @@ Object {
}
},
\\"url\\": \\"http://127.0.0.1:2369/\\",
\\"name\\": \\"Ghost\\",
\\"image\\": {
\\"@type\\": \\"ImageObject\\",
\\"url\\": \\"http://127.0.0.1:2369/content/images/site-cover.png\\"
@ -713,6 +715,7 @@ Object {
}
},
\\"url\\": \\"http://127.0.0.1:2369/\\",
\\"name\\": \\"Ghost\\",
\\"image\\": {
\\"@type\\": \\"ImageObject\\",
\\"url\\": \\"http://127.0.0.1:2369/content/images/site-cover.png\\"
@ -764,6 +767,7 @@ Object {
}
},
\\"url\\": \\"http://127.0.0.1:2369/\\",
\\"name\\": \\"Ghost\\",
\\"image\\": {
\\"@type\\": \\"ImageObject\\",
\\"url\\": \\"http://127.0.0.1:2369/content/images/site-cover.png\\"
@ -878,6 +882,7 @@ Object {
}
},
\\"url\\": \\"http://127.0.0.1:2369/\\",
\\"name\\": \\"Ghost\\",
\\"image\\": {
\\"@type\\": \\"ImageObject\\",
\\"url\\": \\"http://127.0.0.1:2369/content/images/site-cover.png\\"
@ -1727,6 +1732,7 @@ Object {
}
},
\\"url\\": \\"http://127.0.0.1:2369/\\",
\\"name\\": \\"Ghost\\",
\\"image\\": {
\\"@type\\": \\"ImageObject\\",
\\"url\\": \\"http://127.0.0.1:2369/content/images/site-cover.png\\"
@ -1778,6 +1784,7 @@ Object {
}
},
\\"url\\": \\"http://127.0.0.1:2369/\\",
\\"name\\": \\"Ghost\\",
\\"image\\": {
\\"@type\\": \\"ImageObject\\",
\\"url\\": \\"http://127.0.0.1:2369/content/images/site-cover.png\\"
@ -1829,6 +1836,7 @@ Object {
}
},
\\"url\\": \\"http://127.0.0.1:2369/\\",
\\"name\\": \\"Ghost\\",
\\"image\\": {
\\"@type\\": \\"ImageObject\\",
\\"url\\": \\"http://127.0.0.1:2369/content/images/site-cover.png\\"
@ -1942,6 +1950,7 @@ Object {
}
},
\\"url\\": \\"http://127.0.0.1:2369/\\",
\\"name\\": \\"Ghost\\",
\\"image\\": {
\\"@type\\": \\"ImageObject\\",
\\"url\\": \\"http://127.0.0.1:2369/content/images/site-cover.png\\"
@ -2056,6 +2065,7 @@ Object {
}
},
\\"url\\": \\"http://127.0.0.1:2369/\\",
\\"name\\": \\"Ghost\\",
\\"image\\": {
\\"@type\\": \\"ImageObject\\",
\\"url\\": \\"http://127.0.0.1:2369/content/images/site-cover.png\\"
@ -2169,6 +2179,7 @@ Object {
}
},
\\"url\\": \\"http://127.0.0.1:2369/\\",
\\"name\\": \\"Ghost\\",
\\"image\\": {
\\"@type\\": \\"ImageObject\\",
\\"url\\": \\"http://127.0.0.1:2369/content/images/site-cover.png\\"
@ -2283,6 +2294,7 @@ Object {
}
},
\\"url\\": \\"http://127.0.0.1:2369/\\",
\\"name\\": \\"Ghost\\",
\\"image\\": {
\\"@type\\": \\"ImageObject\\",
\\"url\\": \\"http://127.0.0.1:2369/content/images/site-cover.png\\"
@ -2333,6 +2345,7 @@ Object {
}
},
\\"url\\": \\"http://127.0.0.1:2369/\\",
\\"name\\": \\"Ghost\\",
\\"image\\": {
\\"@type\\": \\"ImageObject\\",
\\"url\\": \\"http://127.0.0.1:2369/content/images/site-cover.png\\"
@ -2447,6 +2460,7 @@ Object {
}
},
\\"url\\": \\"http://127.0.0.1:2369/\\",
\\"name\\": \\"Ghost\\",
\\"image\\": {
\\"@type\\": \\"ImageObject\\",
\\"url\\": \\"http://127.0.0.1:2369/content/images/site-cover.png\\"
@ -2698,6 +2712,7 @@ Object {
}
},
\\"url\\": \\"http://localhost:65530/\\",
\\"name\\": \\"Ghost\\",
\\"image\\": {
\\"@type\\": \\"ImageObject\\",
\\"url\\": \\"http://localhost:65530/content/images/site-cover.png\\"
@ -2784,6 +2799,7 @@ Object {
}
},
\\"url\\": \\"http://localhost:65530/\\",
\\"name\\": \\"Ghost\\",
\\"image\\": {
\\"@type\\": \\"ImageObject\\",
\\"url\\": \\"http://localhost:65530/content/images/site-cover.png\\"
@ -2835,6 +2851,7 @@ Object {
}
},
\\"url\\": \\"http://localhost:65530/\\",
\\"name\\": \\"Ghost\\",
\\"image\\": {
\\"@type\\": \\"ImageObject\\",
\\"url\\": \\"http://localhost:65530/content/images/site-cover.png\\"
@ -2973,6 +2990,7 @@ Object {
}
},
\\"url\\": \\"http://localhost:65530/\\",
\\"name\\": \\"Ghost\\",
\\"image\\": {
\\"@type\\": \\"ImageObject\\",
\\"url\\": \\"http://localhost:65530/content/images/site-cover.png\\"
@ -3347,6 +3365,7 @@ Object {
}
},
\\"url\\": \\"http://localhost:65530/\\",
\\"name\\": \\"Ghost\\",
\\"image\\": {
\\"@type\\": \\"ImageObject\\",
\\"url\\": \\"http://localhost:65530/content/images/site-cover.png\\"

View file

@ -487,6 +487,7 @@ describe('getSchema', function () {
height: 500
},
mainEntityOfPage: 'http://mysite.com/post/my-post-slug/',
name: 'Site Title',
publisher: {
'@type': 'Organization',
name: 'Site Title',