0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

🐛 Fixed meta data when using tag data in collection (#12137)

closes #12130 

When defining a collection with a tag as the data source, the metadata
was not correctly applied due to the context array not including 'tag'.

This update keeps the context management all in the same context helper
file and follows the same pattern as for posts/pages as a data source.
This commit is contained in:
Fabien 'egg' O'Carroll 2020-08-17 15:21:09 +01:00 committed by Daniel Lockyer
parent 1a6eec40d1
commit 993e45bd88

View file

@ -71,6 +71,10 @@ function setResponseContext(req, res, data) {
if (!res.locals.context.includes('page')) {
res.locals.context.push('page');
}
} else if (data && data.tag) {
if (!res.locals.context.includes('tag')) {
res.locals.context.push('tag');
}
}
}