蒂娜 CMS 和 Astro
Tina CMS 是一个由 Git 支持的无头内容管理系统。
¥Tina CMS is a Git-backed headless content management system.
与 Astro 集成
Section titled 与 Astro 集成¥Integrating with Astro
首先,你需要一个现有的 Astro 项目。
¥To get started, you’ll need an existing Astro project.
-
Run the following command to install Tina into your Astro project.
- When prompted for a Cloud ID, press Enter to skip. You’ll generate one later if you want to use Tina Cloud.
- When prompted “What framework are you using”, choose Other.
- When asked where public assets are stored, press Enter.
After this has finished, you should now have a
.tina
folder in the root of your project and a generatedhello-world.md
file atcontent/posts
. -
Change the
dev
script inpackage.json
: -
TinaCMS is now set up in local mode. Test this by running the
dev
script, then navigating to/admin/index.html#/collections/post
.Editing the “Hello, World!” post will update the
content/posts/hello-world.md
file in your project directory. -
Set up your Tina collections by editing the
schema.collections
property in.tina/config.ts
.For example, you can add a required “date posted” frontmatter property to our posts:
Learn more about Tina collections in the Tina docs.
-
In production, TinaCMS can commit changes directly to your GitHub repository. To set up TinaCMS for production, you can choose to use Tina Cloud or self-host the Tina Data Layer. You can read more about registering for Tina Cloud in the Tina Docs.
¥Official Resources
¥Community Resources
-
Astro Tina Starter 具有可视化编辑功能 由 Jeff See + Dylan Awalt-Conley 创作
-
汤姆·班尼特的《Astro Tina Starter 具有基本编辑功能》
¥Themes