airtonzanon/ sculpin-contentful-bundle
获取Contentful内容,并将Markdown文件作为文章导入sculpin
0.0.10
2023-05-30 09:16 UTC
Requires
- php: ^8.1
- ext-iconv: *
- contentful/contentful: ^7.0.1
- symfony/console: ^v6.2.10
Requires (Dev)
- infection/infection: ^0.27.0
- malukenho/mcbumpface: ^1.2.0
- phpunit/phpunit: ^10.1.3
- vimeo/psalm: ^5.11.0
Suggests
- sculpin/sculpin: @stable
- dev-master
- 0.0.10
- 0.0.9
- 0.0.8
- 0.0.7
- 0.0.6
- 0.0.5
- 0.0.4
- 0.0.3
- 0.0.2
- 0.0.1
- dev-dependabot/composer/symfony/console-6.4.4
- dev-dependabot/composer/phpunit/phpunit-10.5.11
- dev-dependabot/composer/contentful/contentful-7.0.2
- dev-dependabot/composer/vimeo/psalm-5.22.2
- dev-dependabot/composer/infection/infection-0.27.10
- dev-airton/integration
- dev-update
- dev-php8.1
This package is auto-updated.
Last update: 2024-09-27 19:40:28 UTC
README
使用Contentful作为内容管理系统(CMS),它会从Contentful下载内容并将它们添加到source/_[something]
目录。
如何使用
环境变量
contentful_token=<token> # This is the access token for this space. Normally you get both ID and the token in the Contentful web app
contentful_space_id=<space_id> # This is the space ID. A space is like a project folder in Contentful terms
安装
composer require airtonzanon/sculpin-contentful-bundle dev-master
使用方法
在app/SculpinKernel.php
中应添加
// ... protected function getAdditionalSculpinBundles(): array { return [ SculpinContentfulBundle::class, ]; } // ...
# Environment variables $ export contentful_token=<token> $ export contentful_space_id=<space_id> # Sculpin command $ vendor/bin/sculpin contentful:fetch Created file: source/_til/2021-04-05-first-post.md Created file: source/_til/2020-12-05-second-post.md Created file: source/_til/2020-11-23-third-post.md
在Contentful中
- 内容类型的名称是我们创建的源目录中的名称;
- 字段
language, title, date和contentMarkdown
必须存在;
我们还将添加设置,让用户可以在本包中使用他们特定的字段