Skip to content

Create the blog pages

Create the post, category, listing, and search pages your blog is served on.

Not built yet — This describes where the product is going, not what you can use today. It's documented so the direction is legible — nothing here works yet.

The blog app stores posts but doesn't create pages for them. You create the pages yourself, like any other page on your site, and each one uses a blog section with a blog loader. A typical blog has four:

PageExample pathShows
Post/:slugA single post, chosen by the slug in the URL.
Category/topics/:category*The posts in a category and its subcategories.
Listing/ or /blogThe latest posts, with pagination.
Search/sPosts matching the ?q= search term.

The paths are up to you. Whatever you pick, the post page's path must match the app's Page Slug, and the category page's path must match its Category Slug. See Install the blog app.

Start from the template sections

The blog-tanstack template has a ready-made section for each page in src/sections/Blog/. Copy the ones you need into your site and restyle them:

SectionUsed onWhat it does
BlogPostSection.tsxPost pageRenders the post: cover, authors, a table of contents, the post blocks, and related posts.
BlogHome.tsxListing and category pagesA paginated grid of posts.
BlogSearch.tsxSearch pageA search field and its results.
BlogTopics.tsx, BlogAuthors.tsxOptional index pagesAll categories, or all authors.
BlogHeader.tsxEvery pageThe blog's header, with search and a reading progress bar.

The template's pages are in .deco/blocks/pages-blog-*.json if you want to copy their configuration too.

Create each page

Create the pages in the Site Editor (see Pages) or as page blocks in code. For each one, set the path, add the section, and connect its loader:

  • Post page: add the post section and set its post to the BlogPostPage loader, with the slug read from the URL. For search engines, use the SeoBlogPost SEO section with the same loader.
  • Category page: add the listing section with the BlogpostListing loader (or BlogpostList filtered by category), reading the category from the URL. Use the SeoBlogPostListing SEO section.
  • Listing page: add the listing section with the BlogpostList loader, sorted by newest first.
  • Search page: add the search section with BlogpostList or BlogpostListing. Both read the search term from ?q= in the URL and match titles, excerpts, and content. Mark the page as hidden from search engines.

In code, the post page looks like this. The slug comes from the :slug part of the path:

{
  "name": "Blog Post",
  "path": "/:slug",
  "__resolveType": "website/pages/Page.tsx",
  "sections": [
    {
      "__resolveType": "site/sections/Blog/BlogPostSection.tsx",
      "page": {
        "__resolveType": "blog/loaders/BlogPostPage.ts",
        "slug": { "__resolveType": "website/functions/requestToParam.ts", "param": "slug" }
      }
    }
  ],
  "seo": {
    "__resolveType": "blog/sections/Seo/SeoBlogPost.tsx",
    "jsonLD": {
      "__resolveType": "blog/loaders/BlogPostPage.ts",
      "slug": { "__resolveType": "website/functions/requestToParam.ts", "param": "slug" }
    }
  }
}

Only published posts, and scheduled posts whose go-live time has passed, appear on these pages. The developer reference lists every loader and its options.

Check the pages

  1. Publish the pages with Review & Publish.
  2. Open a post in Content → Blog → Posts and select See preview. It should open your post page.
  3. Do the same from a category with See category preview.

If a preview opens the wrong address, compare the page paths with the app's Page Slug and Category Slug.

Implementation reference: blog-tanstack template. Reviewed 2026-10-09.