Ghost/core/server/data/meta/keywords.js
Rish a4f119cb7f Moved visibility utility from static model fn to Ghost-SDK
refs #10618

- Visibility methods don't belong on model, but are generic utils
- Used directly from ghost helper's visibility methods, cleans up core
- Removes direct model dependency of theme helper
- Updated `foreach_spec` to correct test data as per schema - visibility property cannot be empty
2019-06-09 13:12:04 +05:30

13 lines
364 B
JavaScript

const ghostHelperUtils = require('@tryghost/helpers').utils;
function getKeywords(data) {
if (data.post && data.post.tags && data.post.tags.length > 0) {
return ghostHelperUtils.visibility.filter(data.post.tags, ['public'], function processItem(item) {
return item.name;
});
}
return null;
}
module.exports = getKeywords;