pulsundzeit / kirby-populated-fields-api
Kirby 插件,通过 REST API 提供填充字段
v1.0.2
2022-03-21 12:54 UTC
Requires
- php: >=7.4
- getkirby/composer-installer: ^1.1
This package is auto-updated.
Last update: 2024-09-21 18:09:37 UTC
README
这是一个 Kirby 插件,它通过 REST API 提供填充字段。这对于使用 Kirby 作为无头 CMS 在构建时进行静态站点生成非常有帮助,此时您可能希望在单个请求中获取页面及其所有嵌套资源(文件、页面等)。
安装
手动
下载 并将此存储库复制到您的 Kirby 安装目录下的 /site/plugins/kirby-populated-fields-api
。
Composer
composer require pulsundzeit/kirby-populated-fields-api
用法
该插件在 /api/populated
暴露了一个自定义端点,作为默认 API 的替代品。
示例
api/populated/pages/:id
(https://getkirby.com/docs/reference/api/pages)api/populated/site
(https://getkirby.com/docs/reference/api/site)api/populated/users/:id
(https://getkirby.com/docs/reference/api/users)
身份验证
与默认 Kirby API 请求一样,必须 进行身份验证。