🐛 Fixed Portal not appearing on 404 pages

closes: https://github.com/TryGhost/Ghost/issues/12413

- portal should be included if there is no context so that it appears on 404 pages
- having this inside the if (context) block was an oversight
- we want to chain the accent color style block, so we move this to the end to make that possible
This commit is contained in:
Hannah Wolfe 2021-03-04 21:38:11 +00:00
parent fd0a4692c9
commit 5add79e3d5

View File

@ -167,9 +167,29 @@ module.exports = function ghost_head(options) { // eslint-disable-line camelcase
'\n </script>\n'); '\n </script>\n');
} }
} }
}
if (!_.includes(context, 'amp')) { head.push('<meta name="generator" content="Ghost ' +
head.push(getMembersHelper(options.data)); escapeExpression(safeVersion) + '" />');
head.push('<link rel="alternate" type="application/rss+xml" title="' +
escapeExpression(meta.site.title) + '" href="' +
escapeExpression(meta.rssUrl) + '" />');
// no code injection for amp context!!!
if (!_.includes(context, 'amp')) {
head.push(getMembersHelper(options.data));
if (!_.isEmpty(globalCodeinjection)) {
head.push(globalCodeinjection);
}
if (!_.isEmpty(postCodeInjection)) {
head.push(postCodeInjection);
}
if (!_.isEmpty(tagCodeInjection)) {
head.push(tagCodeInjection);
} }
} }
@ -185,27 +205,6 @@ module.exports = function ghost_head(options) { // eslint-disable-line camelcase
} }
} }
head.push('<meta name="generator" content="Ghost ' +
escapeExpression(safeVersion) + '" />');
head.push('<link rel="alternate" type="application/rss+xml" title="' +
escapeExpression(meta.site.title) + '" href="' +
escapeExpression(meta.rssUrl) + '" />');
// no code injection for amp context!!!
if (!_.includes(context, 'amp')) {
if (!_.isEmpty(globalCodeinjection)) {
head.push(globalCodeinjection);
}
if (!_.isEmpty(postCodeInjection)) {
head.push(postCodeInjection);
}
if (!_.isEmpty(tagCodeInjection)) {
head.push(tagCodeInjection);
}
}
debug('end'); debug('end');
return new SafeString(head.join('\n ').trim()); return new SafeString(head.join('\n ').trim());
}) })