Step 6: Pull the content and generate types
Download the published posts into your project with areca pull, and see the generated types that give your editor autocomplete.
Your website does not ask the CMS for every visitor. Instead, it works from a copy of the published content that lives in your project. The copy is made by pulling. A pull downloads the latest release and writes it into files.
The pull also writes a file called areca.gen.ts. It describes your posts in code, so your editor knows the names of the fields. This is called typed content.
6.1 Run the pull
In your project, run the script that init added:
pnpm content:pullThe command prints three lines. The first starts with Pulled publication, and it lists how many posts it found. The second line is about media (the pictures). The third line says where the types were written.
You should now see these new files and folders:
src/generated/content/areca.gen.ts, the types and thecontentobject. You commit this file to Git.src/generated/content/manifest.jsonand a.publicationsfolder, the downloaded posts. Git ignores these.public/areca/, the downloaded pictures.
6.2 Try the content object
Open src/generated/content/areca.gen.ts and search for posts. You see the fields you wrote in step 3, such as title and coverImage.
The content object is what your code uses to read posts. For example, content.posts.all() returns every post, newest first. You will use it in step 7.
When to pull again
The website reads the files you pulled. When you go live with new posts, pull again so the website has them. Step 9 shows how to pull automatically on every build.
If something went wrong
- The pull says there is no publication. You have not gone live yet. Finish step 5, then pull again.
- The pull says a token is missing. Check
.env.local. It needsARECA_CMS_URLandARECA_SITE_TOKEN. The pull reads that file for you. - The pull says an entry does not match its schema. A post was saved before you changed the plan. Change the post in the CMS to match the plan, mark it ready, go live, then pull again.
Step 5: Write posts and go live
Write two posts for the bakery in the CMS, mark them ready, and go live so the release is ready for your website to read.
Step 7: Show the posts on your website
Build the blog list page and the single post page in TanStack Start, with rich text and pictures from the pulled content.