Is there a reason that og:title and twitter:title do not append the defined global suffix like standard <title> meta tag? I would want it append there as wellā¦
@mat_jack1 hmm I havenāt think of that. We are using it also on social cards.
Maybe adding a checkbox āUse it on the social cardsā would be an all-flexible solution?
When you are generating the HTML for the social cards you can do something different compared to what you do for SEO purposes, or am I missing something?
Heya, just spent some time debugging this as it came in from a Content Author wondering why the title suffix from the preferences isnāt rendering. Having to go back to the client and let them know itās a limitation of DatoCMS and we will have to charge to add this as a bespoke option on quite a large website.
In the end we found the quickest solution was to pass _seoMetaTags to a function like this as it seems it does have the title with suffix as the first entry in the array;
function normaliseMetaTitles(metaTags) {
const titleWithSuffix = metaTags[0]?.content;
if (!titleWithSuffix) return metaTags;
// OG Title and Twitter title array locations;
const indices = [1, 2];
return metaTags.map((tag, index) => {
if (indices.includes(index) && tag?.attributes) {
return {
...tag,
attributes: {
...tag.attributes,
content: titleWithSuffix,
},
};
}
return tag;
});
}
It would be a lot nicer if this was an option, and was mentioned in the docs for the function. Cheers!
Is the ask here to make the title say āDeath Valley Wilderness : Wilderness Light | YouTube.comā, even though youtube.com is already on its own line?