-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(strapi): add strapi #27
Conversation
I'm gonna take some updates first. |
support |
你可以 review 一遍代码,由于
attributes?: {
title: string
content: string
excerpt: string
} 这其实导致的问题是:字段不可控。那么就需要可配置 当前事实上的问题并不是让 现在一个比较尴尬的问题是, request: request({
// key 为 blogkit 标记点,value 为 strapi 配置的变量
attributes: {
title: "title",
content: "content",
excerpt: "excerpt",
},
}), 这样属实难看,而且有点背离设计了。如果强制使用类似 所以是否在 request 或者别的东西需要重新设计,当然这是后话,并不需要因为这个需求而修改 blogkit 的设计 (大不了也直接用环境变量做这个事情)
|
好像理解当初为什么提了一下插件机制,是不是为了能够通过插件去修改一些内部的定义。 像 vite 那样,可以在插件中去修改 definePlugin({
config(config) {
config[prop] = myValue
}
}) 但好像不太应该🤔
reqeust 的出发点就是一层转换,将数据转换为符合 core 里的 Attributes 的格式。 |
没有问题,这是个 Adapter Pattern。现在的问题是“request 可能可以支持一部分自定义能力” 直接写也能达到目的,只要让 reuqest 永远返回的是 Request 就行。但一是看起来不好看了跟设计不太像,二是我怎么看都像有学习成本了.. |
其实 notion database 也是字段随意定,因此我的解决方式是给一个 database 模板 让用户去复制这个模板,来帮助用户做这个事情,不过确实这个方式也只能解决一部分问题。 可能在 request 层需要做更多的探讨。 周末我尝试一下 strapi 就合了😂 。 |
I am merging this, and I will add a basic strapi tutorial to the starter template. |
add strapi support (not sure whether you need it)
it's a really simple version, maybe should take more support when blogkit updated. (configuring with plugin)
and this version must use fields in strapi:
title
,content
,excerpt
thx.