mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 21:33:24 +03:00
Added frontend configs for canary endpoint
no issue Adds url and routing config for new canary endpoint
This commit is contained in:
parent
9ab754a0c7
commit
e1c7c3ebe2
54
core/frontend/services/routing/config/canary.js
Normal file
54
core/frontend/services/routing/config/canary.js
Normal file
@ -0,0 +1,54 @@
|
||||
/* eslint-disable */
|
||||
module.exports.QUERY = {
|
||||
tag: {
|
||||
controller: 'tagsPublic',
|
||||
type: 'read',
|
||||
resource: 'tags',
|
||||
options: {
|
||||
slug: '%s',
|
||||
visibility: 'public'
|
||||
}
|
||||
},
|
||||
author: {
|
||||
controller: 'authorsPublic',
|
||||
type: 'read',
|
||||
resource: 'authors',
|
||||
options: {
|
||||
slug: '%s'
|
||||
}
|
||||
},
|
||||
post: {
|
||||
controller: 'postsPublic',
|
||||
type: 'read',
|
||||
resource: 'posts',
|
||||
options: {
|
||||
slug: '%s'
|
||||
}
|
||||
},
|
||||
page: {
|
||||
controller: 'pagesPublic',
|
||||
type: 'read',
|
||||
resource: 'pages',
|
||||
options: {
|
||||
slug: '%s'
|
||||
}
|
||||
},
|
||||
preview: {
|
||||
controller: 'preview',
|
||||
resource: 'preview'
|
||||
}
|
||||
};
|
||||
|
||||
module.exports.TAXONOMIES = {
|
||||
tag: {
|
||||
filter: 'tags:\'%s\'+tags.visibility:public',
|
||||
editRedirect: '#/settings/tags/:slug/',
|
||||
resource: 'tags'
|
||||
},
|
||||
author: {
|
||||
filter: 'authors:\'%s\'',
|
||||
editRedirect: '#/team/:slug/',
|
||||
resource: 'authors'
|
||||
}
|
||||
};
|
||||
/* eslint-enable */
|
141
core/frontend/services/url/configs/canary.js
Normal file
141
core/frontend/services/url/configs/canary.js
Normal file
@ -0,0 +1,141 @@
|
||||
/*
|
||||
* These are the default resources and filters.
|
||||
* They contain minimum filters for public accessibility of resources.
|
||||
*/
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
type: 'posts',
|
||||
modelOptions: {
|
||||
modelName: 'Post',
|
||||
filter: 'visibility:public+status:published+page:false',
|
||||
exclude: [
|
||||
'title',
|
||||
'mobiledoc',
|
||||
'html',
|
||||
'plaintext',
|
||||
// @TODO: https://github.com/TryGhost/Ghost/issues/10335
|
||||
// 'page',
|
||||
'status',
|
||||
'amp',
|
||||
'codeinjection_head',
|
||||
'codeinjection_foot',
|
||||
'meta_title',
|
||||
'meta_description',
|
||||
'custom_excerpt',
|
||||
'og_image',
|
||||
'og_title',
|
||||
'og_description',
|
||||
'twitter_image',
|
||||
'twitter_title',
|
||||
'twitter_description',
|
||||
'custom_template',
|
||||
'locale'
|
||||
],
|
||||
withRelated: ['tags', 'authors'],
|
||||
withRelatedPrimary: {
|
||||
primary_tag: 'tags',
|
||||
primary_author: 'authors'
|
||||
},
|
||||
withRelatedFields: {
|
||||
tags: ['tags.id', 'tags.slug'],
|
||||
authors: ['users.id', 'users.slug']
|
||||
}
|
||||
},
|
||||
events: {
|
||||
add: 'post.published',
|
||||
update: 'post.published.edited',
|
||||
remove: 'post.unpublished'
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'pages',
|
||||
modelOptions: {
|
||||
modelName: 'Post',
|
||||
exclude: [
|
||||
'title',
|
||||
'mobiledoc',
|
||||
'html',
|
||||
'plaintext',
|
||||
// @TODO: https://github.com/TryGhost/Ghost/issues/10335
|
||||
// 'page',
|
||||
// 'status',
|
||||
'amp',
|
||||
'codeinjection_head',
|
||||
'codeinjection_foot',
|
||||
'meta_title',
|
||||
'meta_description',
|
||||
'custom_excerpt',
|
||||
'og_image',
|
||||
'og_title',
|
||||
'og_description',
|
||||
'twitter_image',
|
||||
'twitter_title',
|
||||
'twitter_description',
|
||||
'custom_template',
|
||||
'locale',
|
||||
'tags',
|
||||
'authors',
|
||||
'primary_tag',
|
||||
'primary_author'
|
||||
],
|
||||
filter: 'visibility:public+status:published+page:true'
|
||||
},
|
||||
events: {
|
||||
add: 'page.published',
|
||||
update: 'page.published.edited',
|
||||
remove: 'page.unpublished'
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'tags',
|
||||
keep: ['id', 'slug'],
|
||||
modelOptions: {
|
||||
modelName: 'Tag',
|
||||
exclude: [
|
||||
'description',
|
||||
'meta_title',
|
||||
'meta_description',
|
||||
'parent_id'
|
||||
],
|
||||
filter: 'visibility:public',
|
||||
shouldHavePosts: {
|
||||
joinTo: 'tag_id',
|
||||
joinTable: 'posts_tags'
|
||||
}
|
||||
},
|
||||
events: {
|
||||
add: 'tag.added',
|
||||
update: ['tag.edited', 'tag.attached', 'tag.detached'],
|
||||
remove: 'tag.deleted'
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'authors',
|
||||
modelOptions: {
|
||||
modelName: 'User',
|
||||
exclude: [
|
||||
'bio',
|
||||
'website',
|
||||
'location',
|
||||
'facebook',
|
||||
'twitter',
|
||||
'locale',
|
||||
'accessibility',
|
||||
'meta_title',
|
||||
'meta_description',
|
||||
'tour'
|
||||
],
|
||||
filter: 'visibility:public',
|
||||
shouldHavePosts: {
|
||||
joinTo: 'author_id',
|
||||
joinTable: 'posts_authors'
|
||||
}
|
||||
},
|
||||
events: {
|
||||
add: 'user.activated',
|
||||
update: ['user.activated.edited', 'user.attached', 'user.detached'],
|
||||
remove: 'user.deleted'
|
||||
}
|
||||
}
|
||||
];
|
Loading…
Reference in New Issue
Block a user