mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-17 13:31:39 +03:00
16f5d1fdaf
refs #7488 - to be able to refactor the url configuration in ghost, we need to go step by step making this possible - reduce the usage of forceAdminSSL - add a urlFor('admin') helper, which returns the admin url + path e.g. http://my-blog.com/blog/ghost - increase usage of urlFor helper - do not expose getBaseUrl, use urlFor('home') (home === blog)
57 lines
1.6 KiB
JavaScript
57 lines
1.6 KiB
JavaScript
var _ = require('lodash'),
|
|
config = require('../../config'),
|
|
utils = require('../../utils'),
|
|
channelConfig;
|
|
|
|
channelConfig = function channelConfig() {
|
|
var defaults = {
|
|
index: {
|
|
name: 'index',
|
|
route: '/',
|
|
frontPageTemplate: 'home'
|
|
},
|
|
tag: {
|
|
name: 'tag',
|
|
route: utils.url.urlJoin('/', 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: utils.url.urlJoin(utils.url.urlFor('admin'), '/settings/tags/:slug/')
|
|
},
|
|
author: {
|
|
name: 'author',
|
|
route: utils.url.urlJoin('/', config.get('routeKeywords').author, ':slug/'),
|
|
postOptions: {
|
|
filter: 'author:\'%s\''
|
|
},
|
|
data: {
|
|
author: {
|
|
type: 'read',
|
|
resource: 'users',
|
|
options: {slug: '%s'}
|
|
}
|
|
},
|
|
slugTemplate: true,
|
|
editRedirect: utils.url.urlJoin(utils.url.urlFor('admin'), '/team/:slug/')
|
|
}
|
|
};
|
|
|
|
return defaults;
|
|
};
|
|
|
|
module.exports.list = function list() {
|
|
return channelConfig();
|
|
};
|
|
|
|
module.exports.get = function get(name) {
|
|
return _.cloneDeep(channelConfig()[name]);
|
|
};
|