a4f119cb7f
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
13 lines
364 B
JavaScript
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;
|