mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-20 09:22:49 +03:00
de66a61f59
closes #7348 - only filter keywords if the internal tag lab feature is turned on
17 lines
438 B
JavaScript
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;
|
|
|