Ghost/core/server/data/meta/keywords.js
Hannah Wolfe de66a61f59 hides internal tags from displaying in meta data (#7379)
closes #7348

- only filter keywords if the internal tag lab feature is turned on
2016-09-14 17:33:24 +00:00

17 lines
438 B
JavaScript

var labs = require('../../utils/labs');
function getKeywords(data) {
if (data.post && data.post.tags && data.post.tags.length > 0) {
return data.post.tags.reduce(function (tags, tag) {
if (tag.visibility !== 'internal' || !labs.isSet('internalTags')) {
tags.push(tag.name);
}
return tags;
}, []);
}
return null;
}
module.exports = getKeywords;