Content and Collections
Create blog posts, products, portfolio projects and text pages, then manage their relationships, archive views and draft status.
Add a blog post
Section titled “Add a blog post”Create src/content/blog/authors/editor.json:
{ "id": "editor", "name": "Your editor", "bio": "About your editor." }Create src/content/blog/categories/garden.json:
{ "id": "garden", "slug": "garden", "name": "Garden" }Add your own image at src/assets/garden.jpg, then create src/content/blog/posts/garden-notes.mdx:
---id: garden-notesslug: garden-notestitle: Garden notesdescription: Notes from our garden.publishDate: "2026-10-29"author: editorcategories: [garden]coverImage: ../../../assets/garden.jpgcoverImageAlt: Our garden in autumndraft: false---
import ContentImage from '@rtthemes/naturalife/components/ContentImage.astro';import photo from '../../../assets/garden.jpg';
## A fresh start
Write your article here.
<ContentImage src={photo} alt="Our garden in autumn" />This exact folder depth needs three ../ segments for the image. A deeper folder needs another segment. Run npm run check and npm run build, then preview /blog/garden-notes/. The post also appears in the generated blog, category and author archives.
IDs, authors and taxonomies
Section titled “IDs, authors and taxonomies”Keep id stable. Relationships use IDs, not display names or filenames; slug controls the normal public URL. Blog tags are JSON records under src/content/blog/tags/ and are selected through the post’s tags IDs. Categories can use parent with another category ID in the same content type. Changing a parent does not change the category URL.
Missing references, duplicate identities, category cycles and URL collisions fail validation. Draft records also need valid references. When changing a published slug, arrange a redirect from the old URL.
Add a product or portfolio project
Section titled “Add a product or portfolio project”Add your image at src/assets/garden-set.jpg. Create src/content/products/items/garden-set.mdx:
---id: garden-setslug: garden-settitle: Garden setdescription: A demonstration garden set.coverImage: ../../../assets/garden-set.jpgcoverImageAlt: Garden tool setpriceLabel: "$20.00"priceCents: 2000currency: USDcategories: []tags: []---
Write the product description here.It appears at /products/garden-set/. Product categories and tags have their own JSON folders under src/content/products/. Optional related contains product IDs. priceCents is a nonnegative integer used by the local demo cart; priceLabel is display text. These fields do not connect a payment service.
For a project, create src/content/portfolio/items/garden-project.mdx with the same identity, title, description and cover fields, and omit the price/currency/tags fields. Use optional categories, related, images and project label/value facts as needed. It appears at /portfolio/garden-project/; category JSON belongs under src/content/portfolio/categories/. There is no portfolio tag collection.
Ordinary records need no presentation object. Supplied complex gallery, video, split, sticky or tabbed variants retain structured presentation settings; their dedicated panels are not replaced by arbitrary MDX body text.
Add a plain text page
Section titled “Add a plain text page”Create src/content/documents/our-story.mdx:
---id: our-storyslug: our-storytitle: Our storydescription: How we started.---
## Our beginning
Write your story here.The customer catch-all route generates /our-story/. Optional width: wide, breadcrumbs: false, lang and seo adjust the document layout. Do not choose a URL already owned by another route. Designed pages continue to use JSON plus Astro composition.
Cards, archives and drafts
Section titled “Cards, archives and drafts”One record supplies its detail and collection views. Generated archives use six records per page, with real /page/2/ links. Change the page size in src/lib/pagination.ts.
draft: true removes a record from generated detail routes, published queries, selected cards and sitemap output. Your explicitly authored navigation and campaign links still need maintenance. Curated sections do not automatically include every new record.
Get all RT-Themes designs, updates and support with a single Club license.
Join the Club