content structure
This commit is contained in:
parent
89e7148bd4
commit
49841e72c0
10 changed files with 117 additions and 5 deletions
|
|
@ -6,6 +6,7 @@ services:
|
|||
image: strapi-cms:latest
|
||||
restart: unless-stopped
|
||||
env_file: .env
|
||||
user: "${DOCKER_USER:-1000}:${DOCKER_GROUP:-1000}"
|
||||
environment:
|
||||
DATABASE_CLIENT: ${DATABASE_CLIENT}
|
||||
DATABASE_HOST: strapiDB
|
||||
|
|
|
|||
|
|
@ -11,9 +11,12 @@
|
|||
},
|
||||
"pluginOptions": {},
|
||||
"attributes": {
|
||||
"mosaic_items": {
|
||||
"header_copy": {
|
||||
"type": "blocks"
|
||||
},
|
||||
"header_dl": {
|
||||
"type": "component",
|
||||
"component": "global.mosaic-item",
|
||||
"component": "global.descriptive-list",
|
||||
"repeatable": true
|
||||
},
|
||||
"seo": {
|
||||
|
|
|
|||
20
src/api/home/content-types/home/schema.json
Normal file
20
src/api/home/content-types/home/schema.json
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"kind": "singleType",
|
||||
"collectionName": "homes",
|
||||
"info": {
|
||||
"singularName": "home",
|
||||
"pluralName": "homes",
|
||||
"displayName": "Home"
|
||||
},
|
||||
"options": {
|
||||
"draftAndPublish": true
|
||||
},
|
||||
"pluginOptions": {},
|
||||
"attributes": {
|
||||
"mosaic_items": {
|
||||
"type": "component",
|
||||
"component": "global.mosaic-item",
|
||||
"repeatable": true
|
||||
}
|
||||
}
|
||||
}
|
||||
7
src/api/home/controllers/home.ts
Normal file
7
src/api/home/controllers/home.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/**
|
||||
* home controller
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreController('api::home.home');
|
||||
7
src/api/home/routes/home.ts
Normal file
7
src/api/home/routes/home.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/**
|
||||
* home router
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreRouter('api::home.home');
|
||||
7
src/api/home/services/home.ts
Normal file
7
src/api/home/services/home.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/**
|
||||
* home service
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreService('api::home.home');
|
||||
17
src/components/global/descriptive-list.json
Normal file
17
src/components/global/descriptive-list.json
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"collectionName": "components_global_descriptive_lists",
|
||||
"info": {
|
||||
"displayName": "Descriptive List",
|
||||
"icon": "bulletList"
|
||||
},
|
||||
"options": {},
|
||||
"attributes": {
|
||||
"label": {
|
||||
"type": "string"
|
||||
},
|
||||
"content": {
|
||||
"type": "blocks"
|
||||
}
|
||||
},
|
||||
"config": {}
|
||||
}
|
||||
|
|
@ -13,7 +13,15 @@
|
|||
"images"
|
||||
]
|
||||
},
|
||||
"note": {
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"dl": {
|
||||
"type": "component",
|
||||
"component": "global.descriptive-list",
|
||||
"repeatable": true
|
||||
},
|
||||
"content": {
|
||||
"type": "blocks"
|
||||
}
|
||||
},
|
||||
|
|
|
|||
17
types/generated/components.d.ts
vendored
17
types/generated/components.d.ts
vendored
|
|
@ -1,5 +1,17 @@
|
|||
import type { Schema, Struct } from '@strapi/strapi';
|
||||
|
||||
export interface GlobalDescriptiveList extends Struct.ComponentSchema {
|
||||
collectionName: 'components_global_descriptive_lists';
|
||||
info: {
|
||||
displayName: 'Descriptive List';
|
||||
icon: 'bulletList';
|
||||
};
|
||||
attributes: {
|
||||
content: Schema.Attribute.Blocks;
|
||||
label: Schema.Attribute.String;
|
||||
};
|
||||
}
|
||||
|
||||
export interface GlobalMosaicItem extends Struct.ComponentSchema {
|
||||
collectionName: 'components_global_mosaic_items';
|
||||
info: {
|
||||
|
|
@ -7,8 +19,10 @@ export interface GlobalMosaicItem extends Struct.ComponentSchema {
|
|||
icon: 'apps';
|
||||
};
|
||||
attributes: {
|
||||
content: Schema.Attribute.Blocks;
|
||||
dl: Schema.Attribute.Component<'global.descriptive-list', true>;
|
||||
image: Schema.Attribute.Media<'images'>;
|
||||
note: Schema.Attribute.Blocks;
|
||||
title: Schema.Attribute.String;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -28,6 +42,7 @@ export interface GlobalSeo extends Struct.ComponentSchema {
|
|||
declare module '@strapi/strapi' {
|
||||
export module Public {
|
||||
export interface ComponentSchemas {
|
||||
'global.descriptive-list': GlobalDescriptiveList;
|
||||
'global.mosaic-item': GlobalMosaicItem;
|
||||
'global.seo': GlobalSeo;
|
||||
}
|
||||
|
|
|
|||
29
types/generated/contentTypes.d.ts
vendored
29
types/generated/contentTypes.d.ts
vendored
|
|
@ -454,13 +454,14 @@ export interface ApiGlobalGlobal extends Struct.SingleTypeSchema {
|
|||
createdAt: Schema.Attribute.DateTime;
|
||||
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
Schema.Attribute.Private;
|
||||
header_copy: Schema.Attribute.Blocks;
|
||||
header_dl: Schema.Attribute.Component<'global.descriptive-list', true>;
|
||||
locale: Schema.Attribute.String & Schema.Attribute.Private;
|
||||
localizations: Schema.Attribute.Relation<
|
||||
'oneToMany',
|
||||
'api::global.global'
|
||||
> &
|
||||
Schema.Attribute.Private;
|
||||
mosaic_items: Schema.Attribute.Component<'global.mosaic-item', true>;
|
||||
publishedAt: Schema.Attribute.DateTime;
|
||||
seo: Schema.Attribute.Component<'global.seo', false>;
|
||||
updatedAt: Schema.Attribute.DateTime;
|
||||
|
|
@ -469,6 +470,31 @@ export interface ApiGlobalGlobal extends Struct.SingleTypeSchema {
|
|||
};
|
||||
}
|
||||
|
||||
export interface ApiHomeHome extends Struct.SingleTypeSchema {
|
||||
collectionName: 'homes';
|
||||
info: {
|
||||
displayName: 'Home';
|
||||
pluralName: 'homes';
|
||||
singularName: 'home';
|
||||
};
|
||||
options: {
|
||||
draftAndPublish: true;
|
||||
};
|
||||
attributes: {
|
||||
createdAt: Schema.Attribute.DateTime;
|
||||
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
Schema.Attribute.Private;
|
||||
locale: Schema.Attribute.String & Schema.Attribute.Private;
|
||||
localizations: Schema.Attribute.Relation<'oneToMany', 'api::home.home'> &
|
||||
Schema.Attribute.Private;
|
||||
mosaic_items: Schema.Attribute.Component<'global.mosaic-item', true>;
|
||||
publishedAt: Schema.Attribute.DateTime;
|
||||
updatedAt: Schema.Attribute.DateTime;
|
||||
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
Schema.Attribute.Private;
|
||||
};
|
||||
}
|
||||
|
||||
export interface PluginContentReleasesRelease
|
||||
extends Struct.CollectionTypeSchema {
|
||||
collectionName: 'strapi_releases';
|
||||
|
|
@ -981,6 +1007,7 @@ declare module '@strapi/strapi' {
|
|||
'admin::transfer-token-permission': AdminTransferTokenPermission;
|
||||
'admin::user': AdminUser;
|
||||
'api::global.global': ApiGlobalGlobal;
|
||||
'api::home.home': ApiHomeHome;
|
||||
'plugin::content-releases.release': PluginContentReleasesRelease;
|
||||
'plugin::content-releases.release-action': PluginContentReleasesReleaseAction;
|
||||
'plugin::i18n.locale': PluginI18NLocale;
|
||||
|
|
|
|||
Loading…
Reference in a new issue