mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-25 19:48:50 +03:00
🐛 Fixed broken structured data previews
closes https://github.com/TryGhost/Ghost/issues/11385 - Updates og and twitter description to use correct fallbacks for posts/pages - Updates og and twitter description to use correct fallback for tags - Updates og and twitter title to use correct name format for tags
This commit is contained in:
parent
63ea14327a
commit
a38d7ddb19
@ -40,10 +40,10 @@ export default Component.extend(SettingsMenuMixin, {
|
||||
twitterTitleScratch: alias('post.twitterTitleScratch'),
|
||||
slugValue: boundOneWay('post.slug'),
|
||||
|
||||
facebookDescription: or('ogDescriptionScratch', 'customExcerptScratch', 'seoDescription'),
|
||||
facebookDescription: or('ogDescriptionScratch', 'customExcerptScratch', 'seoDescription', 'post.excerpt', 'settings.description', ''),
|
||||
facebookImage: or('post.ogImage', 'post.featureImage'),
|
||||
facebookTitle: or('ogTitleScratch', 'seoTitle'),
|
||||
twitterDescription: or('twitterDescriptionScratch', 'customExcerptScratch', 'seoDescription'),
|
||||
twitterDescription: or('twitterDescriptionScratch', 'customExcerptScratch', 'seoDescription', 'post.excerpt', 'settings.description', ''),
|
||||
twitterImage: or('post.twitterImage', 'post.featureImage'),
|
||||
twitterTitle: or('twitterTitleScratch', 'seoTitle'),
|
||||
|
||||
|
@ -11,6 +11,7 @@ const {Handlebars} = Ember;
|
||||
export default Component.extend({
|
||||
feature: service(),
|
||||
config: service(),
|
||||
settings: service(),
|
||||
|
||||
tag: null,
|
||||
scratchTag: null,
|
||||
@ -19,11 +20,11 @@ export default Component.extend({
|
||||
setProperty: () => {},
|
||||
|
||||
twitterTitle: or('scratchTag.twitterTitle', 'seoTitle'),
|
||||
twitterDescription: or('scratchTag.twitterDescription', 'seoDescription'),
|
||||
twitterDescription: or('scratchTag.twitterDescription', 'seoDescription', 'settings.metaDescription', ''),
|
||||
twitterImage: or('tag.twitterImage', 'tag.featureImage'),
|
||||
|
||||
facebookTitle: or('scratchTag.ogTitle', 'seoTitle'),
|
||||
facebookDescription: or('scratchTag.ogDescription', 'seoDescription'),
|
||||
facebookDescription: or('scratchTag.ogDescription', 'seoDescription', 'settings.metaDescription', ''),
|
||||
facebookImage: or('tag.ogImage', 'tag.featureImage'),
|
||||
|
||||
accentColor: computed('tag.accentColor', function () {
|
||||
@ -48,7 +49,9 @@ export default Component.extend({
|
||||
}),
|
||||
|
||||
seoTitle: computed('scratchTag.{name,metaTitle}', function () {
|
||||
let metaTitle = this.scratchTag.metaTitle || this.scratchTag.name;
|
||||
const settingsTitle = this.get('settings.title') || '';
|
||||
const tagName = settingsTitle ? `${this.scratchTag.name} - ${settingsTitle}` : this.scratchTag.name;
|
||||
let metaTitle = this.scratchTag.metaTitle || tagName;
|
||||
|
||||
if (metaTitle && metaTitle.length > 70) {
|
||||
metaTitle = metaTitle.substring(0, 70).trim();
|
||||
|
Loading…
Reference in New Issue
Block a user