mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Added v4 frontend url config
issue https://github.com/TryGhost/Team/issues/221 We can't alias it so we have to duplicate the configuration already.
This commit is contained in:
parent
a551970315
commit
b77f431f56
2 changed files with 145 additions and 0 deletions
|
@ -3,6 +3,8 @@
|
|||
* They contain minimum filters for public accessibility of resources.
|
||||
*/
|
||||
|
||||
// @TODO: keep this similar to ./v4.js until the v5 release
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
type: 'posts',
|
||||
|
|
143
core/frontend/services/url/configs/v4.js
Normal file
143
core/frontend/services/url/configs/v4.js
Normal file
|
@ -0,0 +1,143 @@
|
|||
/*
|
||||
* These are the default resources and filters.
|
||||
* They contain minimum filters for public accessibility of resources.
|
||||
*/
|
||||
|
||||
// @TODO: keep this similar to ./canary.js until the v5 release
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
type: 'posts',
|
||||
modelOptions: {
|
||||
modelName: 'Post',
|
||||
filter: 'status:published+type: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'
|
||||
],
|
||||
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: 'status:published+type:page'
|
||||
},
|
||||
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…
Add table
Reference in a new issue