blog #4

Merged
baobeld merged 5 commits from blog into main 2025-05-05 13:02:22 -04:00
8 changed files with 114 additions and 1 deletions
Showing only changes of commit 4c49c570b6 - Show all commits

View file

@ -6,7 +6,7 @@ ENV NODE_ENV=${NODE_ENV}
WORKDIR /opt/ WORKDIR /opt/
COPY package.json bun.lock ./ COPY package.json bun.lock ./
RUN bun add --global node-gyp && bun install --production --frozen-lockfile RUN bun add --global node-gyp && bun install --filter 'strapi' --production --frozen-lockfile
ENV PATH=/opt/node_modules/.bin:$PATH ENV PATH=/opt/node_modules/.bin:$PATH
WORKDIR /opt/app WORKDIR /opt/app
COPY . . COPY . .

View file

@ -0,0 +1,38 @@
{
"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"
]
}
}
}

View file

@ -0,0 +1,7 @@
/**
* blog controller
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreController('api::blog.blog');

View file

@ -0,0 +1,7 @@
/**
* blog router
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreRouter('api::blog.blog');

View file

@ -0,0 +1,7 @@
/**
* blog service
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreService('api::blog.blog');

View file

@ -0,0 +1,14 @@
{
"collectionName": "components_shared_tags",
"info": {
"displayName": "Tag",
"icon": "priceTag"
},
"options": {},
"attributes": {
"Topic": {
"type": "enumeration",
"enum": ["development", "work", "life"]
}
}
}

View file

@ -50,6 +50,17 @@ export interface SharedSeo extends Struct.ComponentSchema {
}; };
} }
export interface SharedTag extends Struct.ComponentSchema {
collectionName: 'components_shared_tags';
info: {
displayName: 'Tag';
icon: 'priceTag';
};
attributes: {
Topic: Schema.Attribute.Enumeration<['development', 'work', 'life']>;
};
}
declare module '@strapi/strapi' { declare module '@strapi/strapi' {
export module Public { export module Public {
export interface ComponentSchemas { export interface ComponentSchemas {
@ -57,6 +68,7 @@ declare module '@strapi/strapi' {
'shared.quote': SharedQuote; 'shared.quote': SharedQuote;
'shared.rich-text': SharedRichText; 'shared.rich-text': SharedRichText;
'shared.seo': SharedSeo; 'shared.seo': SharedSeo;
'shared.tag': SharedTag;
} }
} }
} }

View file

@ -336,6 +336,33 @@ export interface AdminUser extends Struct.CollectionTypeSchema {
}; };
} }
export interface ApiBlogBlog extends Struct.CollectionTypeSchema {
collectionName: 'blogs';
info: {
description: '';
displayName: 'Blog';
pluralName: 'blogs';
singularName: 'blog';
};
options: {
draftAndPublish: true;
};
attributes: {
Body: Schema.Attribute.RichText & Schema.Attribute.Required;
createdAt: Schema.Attribute.DateTime;
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & Schema.Attribute.Private;
Header: Schema.Attribute.Media<'images'> & Schema.Attribute.Required;
locale: Schema.Attribute.String & Schema.Attribute.Private;
localizations: Schema.Attribute.Relation<'oneToMany', 'api::blog.blog'> &
Schema.Attribute.Private;
publishedAt: Schema.Attribute.DateTime;
Title: Schema.Attribute.String & Schema.Attribute.Required & Schema.Attribute.Unique;
Topics: Schema.Attribute.Component<'shared.tag', true>;
updatedAt: Schema.Attribute.DateTime;
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & Schema.Attribute.Private;
};
}
export interface PluginContentReleasesRelease extends Struct.CollectionTypeSchema { export interface PluginContentReleasesRelease extends Struct.CollectionTypeSchema {
collectionName: 'strapi_releases'; collectionName: 'strapi_releases';
info: { info: {
@ -763,6 +790,7 @@ declare module '@strapi/strapi' {
'admin::transfer-token': AdminTransferToken; 'admin::transfer-token': AdminTransferToken;
'admin::transfer-token-permission': AdminTransferTokenPermission; 'admin::transfer-token-permission': AdminTransferTokenPermission;
'admin::user': AdminUser; 'admin::user': AdminUser;
'api::blog.blog': ApiBlogBlog;
'plugin::content-releases.release': PluginContentReleasesRelease; 'plugin::content-releases.release': PluginContentReleasesRelease;
'plugin::content-releases.release-action': PluginContentReleasesReleaseAction; 'plugin::content-releases.release-action': PluginContentReleasesReleaseAction;
'plugin::i18n.locale': PluginI18NLocale; 'plugin::i18n.locale': PluginI18NLocale;