mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
Updated ghost_head & ghost_foot to work with tags
no-issue This adds support for tags codeinjection to work with the ghost_head and ghost_foot helpers
This commit is contained in:
parent
2dd302a23e
commit
1d8154f892
@ -11,6 +11,7 @@ module.exports = function ghost_foot(options) { // eslint-disable-line camelcase
|
||||
|
||||
const globalCodeinjection = settingsCache.get('codeinjection_foot');
|
||||
const postCodeinjection = options.data.root && options.data.root.post ? options.data.root.post.codeinjection_foot : null;
|
||||
const tagCodeinjection = options.data.root && options.data.root.tag ? options.data.root.tag.codeinjection_foot : null;
|
||||
|
||||
if (!_.isEmpty(globalCodeinjection)) {
|
||||
foot.push(globalCodeinjection);
|
||||
@ -20,5 +21,9 @@ module.exports = function ghost_foot(options) { // eslint-disable-line camelcase
|
||||
foot.push(postCodeinjection);
|
||||
}
|
||||
|
||||
if (!_.isEmpty(tagCodeinjection)) {
|
||||
foot.push(tagCodeinjection);
|
||||
}
|
||||
|
||||
return new SafeString(foot.join(' ').trim());
|
||||
};
|
||||
|
@ -99,6 +99,7 @@ module.exports = function ghost_head(options) { // eslint-disable-line camelcase
|
||||
const context = dataRoot._locals.context ? dataRoot._locals.context : null;
|
||||
const safeVersion = dataRoot._locals.safeVersion;
|
||||
const postCodeInjection = dataRoot && dataRoot.post ? dataRoot.post.codeinjection_head : null;
|
||||
const tagCodeInjection = dataRoot && dataRoot.tag ? dataRoot.tag.codeinjection_head : null;
|
||||
const globalCodeinjection = settingsCache.get('codeinjection_head');
|
||||
const useStructuredData = !config.isPrivacyDisabled('useStructuredData');
|
||||
const referrerPolicy = config.get('referrerPolicy') ? config.get('referrerPolicy') : 'no-referrer-when-downgrade';
|
||||
@ -189,6 +190,10 @@ module.exports = function ghost_head(options) { // eslint-disable-line camelcase
|
||||
if (!_.isEmpty(postCodeInjection)) {
|
||||
head.push(postCodeInjection);
|
||||
}
|
||||
|
||||
if (!_.isEmpty(tagCodeInjection)) {
|
||||
head.push(tagCodeInjection);
|
||||
}
|
||||
}
|
||||
debug('end');
|
||||
return new SafeString(head.join('\n ').trim());
|
||||
|
Loading…
Reference in New Issue
Block a user