mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 11:34:24 +03:00
63094d3cc7
closes #6165 - internal tags has been in labs for a couple of months, we've fixed some bugs & are ready to ship - removes all code that tests for the labs flag - also refactors the various usage of the visibility filter into a single util - all the tests still pass!!! - this marks #6165 as closed because I think the remaining UI tasks will be handled as part of a larger piece of work
56 lines
1.4 KiB
JavaScript
56 lines
1.4 KiB
JavaScript
var _ = require('lodash'),
|
|
config = require('../../config'),
|
|
channelConfig;
|
|
|
|
channelConfig = function channelConfig() {
|
|
var defaults = {
|
|
index: {
|
|
name: 'index',
|
|
route: '/',
|
|
frontPageTemplate: 'home'
|
|
},
|
|
tag: {
|
|
name: 'tag',
|
|
route: '/' + config.get('routeKeywords').tag + '/:slug/',
|
|
postOptions: {
|
|
filter: 'tags:\'%s\'+tags.visibility:\'public\''
|
|
},
|
|
data: {
|
|
tag: {
|
|
type: 'read',
|
|
resource: 'tags',
|
|
options: {slug: '%s', visibility: 'public'}
|
|
}
|
|
},
|
|
slugTemplate: true,
|
|
editRedirect: '/ghost/settings/tags/:slug/'
|
|
},
|
|
author: {
|
|
name: 'author',
|
|
route: '/' + config.get('routeKeywords').author + '/:slug/',
|
|
postOptions: {
|
|
filter: 'author:\'%s\''
|
|
},
|
|
data: {
|
|
author: {
|
|
type: 'read',
|
|
resource: 'users',
|
|
options: {slug: '%s'}
|
|
}
|
|
},
|
|
slugTemplate: true,
|
|
editRedirect: '/ghost/team/:slug/'
|
|
}
|
|
};
|
|
|
|
return defaults;
|
|
};
|
|
|
|
module.exports.list = function list() {
|
|
return channelConfig();
|
|
};
|
|
|
|
module.exports.get = function get(name) {
|
|
return _.cloneDeep(channelConfig()[name]);
|
|
};
|