blog (#4)
Co-authored-by: Benjamin Palko <benjaminpalko@hotmail.com> Reviewed-on: #4
This commit is contained in:
parent
b2844e8d76
commit
14fe55bb31
18 changed files with 3164 additions and 30 deletions
36
strapi/src/api/blog/content-types/blog/schema.json
Normal file
36
strapi/src/api/blog/content-types/blog/schema.json
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"kind": "collectionType",
|
||||
"collectionName": "blogs",
|
||||
"info": {
|
||||
"singularName": "blog",
|
||||
"pluralName": "blogs",
|
||||
"displayName": "Blog",
|
||||
"description": ""
|
||||
},
|
||||
"options": {
|
||||
"draftAndPublish": true
|
||||
},
|
||||
"attributes": {
|
||||
"Title": {
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"unique": true
|
||||
},
|
||||
"Body": {
|
||||
"type": "richtext",
|
||||
"required": true
|
||||
},
|
||||
"Topics": {
|
||||
"displayName": "Tag",
|
||||
"type": "component",
|
||||
"repeatable": true,
|
||||
"component": "shared.tag"
|
||||
},
|
||||
"Header": {
|
||||
"type": "media",
|
||||
"multiple": false,
|
||||
"required": true,
|
||||
"allowedTypes": ["images"]
|
||||
}
|
||||
}
|
||||
}
|
||||
7
strapi/src/api/blog/controllers/blog.ts
Normal file
7
strapi/src/api/blog/controllers/blog.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/**
|
||||
* blog controller
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreController('api::blog.blog');
|
||||
7
strapi/src/api/blog/routes/blog.ts
Normal file
7
strapi/src/api/blog/routes/blog.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/**
|
||||
* blog router
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreRouter('api::blog.blog');
|
||||
7
strapi/src/api/blog/services/blog.ts
Normal file
7
strapi/src/api/blog/services/blog.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/**
|
||||
* blog service
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreService('api::blog.blog');
|
||||
14
strapi/src/components/shared/tag.json
Normal file
14
strapi/src/components/shared/tag.json
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"collectionName": "components_shared_tags",
|
||||
"info": {
|
||||
"displayName": "Tag",
|
||||
"icon": "priceTag"
|
||||
},
|
||||
"options": {},
|
||||
"attributes": {
|
||||
"Topic": {
|
||||
"type": "enumeration",
|
||||
"enum": ["development", "work", "life"]
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue