Skip to content
Docs
    Menu

    Worked examples

    Start a blog

    Ask the AI for a blog, review the collection and pages it builds, then write and publish posts that go live without republishing your site.

    In this tutorial you add a blog to an existing site. The AI creates a collection to hold your posts, a listing page and a page for each post. You then write a post in the CMS and publish it.

    Blog posts are content, not pages: each post is an item in the collection. Once your site has been published with the blog pages in it, you publish each post on its own, and it appears on your live site within a few seconds. You don't republish the site for each post.

    Before you start

    • You need a site to add the blog to. Any site works, including the one from Build a business site.
    • Save or Reject any open AI session before you start, so the blog work is a session of its own.

    Ask the AI for a blog

    1. 01

      Open the AI panel

      In the editor, click the AI button at the top right.

    2. 02

      Ask for the blog

      Send:

      Add a blog. Each post needs a title, a slug, a publish date, a cover image with
      alt text, a short excerpt and a Markdown body. Build a /blog page that lists
      posts newest first with their cover image, title, date and excerpt, and a page
      for each post. Add "Blog" to the header navigation. Create three sample posts
      about baking sourdough at home.
      
    3. 03

      Watch what it builds

      The AI creates the collection and its sample posts, then builds two pages: the listing page at /blog and a post page that shows one post at a time (for example /blog/your-first-loaf).

    4. 04

      Look at the pages

      Open the Pages panel. You see the blog listing page and the post page. Click the post page: the top bar shows a menu for choosing which post to preview. Pick a different post from it to see that post on the canvas.

      On the canvas, the pages show every post, including drafts, so you can see your work before it's published.

    5. 05

      Save the session

      In the AI Session bar at the bottom of the AI panel, click Save.

      Posts the AI created or changed in this session can't be published until you Save or Reject.

    Publish the site once

    The blog pages are part of your site's code, so they reach your live site the next time you publish the site.

    1. 01

      Publish the site

      Click Publish at the top right, then the Publish (or Republish) button in the panel. Wait for the status to show Live.

    2. 02

      Check the live blog page

      Open your live address and go to /blog. The list is empty. That's expected: the sample posts are still drafts, and visitors only see published posts.

    Write and publish a post

    1. 01

      Open the CMS

      In the top bar, open the view menu (it shows Canvas) and choose CMS. Under Collections, click your blog collection. The table lists the posts, with a Status column showing Draft for each.

    2. 02

      Create a post

      Click the + button (New item). Fill in the title, publish date and excerpt. Write the body in the Markdown field. For the cover image, pick an image from your library and fill in its alt text.

      There is no Save button. The post saves itself as you type. If a value isn't the right kind, the field says Not saved: and what it needs.

    3. 03

      Check what publishing needs

      If a required field is still empty, the header says To publish: and what's missing. Fill it in.

    4. 04

      Publish the post

      Click Publish in the post's header. A dialog explains that the post Goes live on your site within a few seconds. The rest of the site isn't republished. Click Publish to confirm.

    5. 05

      See it live

      Reload /blog on your live site. Your post appears in the list. Click it to open its page.

    Publish the sample posts, or delete them

    To publish everything that's ready at once, open the collection and click Publish all changes. To remove a sample post, open it, click ⋯ and choose Delete. Deleting is permanent.

    Edit a published post

    Open the post and change it. The table's Status column shows Live · changed: visitors still see the published version. Click Publish again to put your changes live. In the post's header, the Published and Draft pills let you switch between the live version (read-only) and your draft.

    To take a post off your site, click ⋯ and choose Unpublish. Its draft stays, so you can publish it again later.

    If something goes wrong

    Problem What to do
    Publish is greyed out on a post. Save or Reject the AI session first. Also check the header for To publish: and fill in what's missing.
    The post is published but /blog on the live site still doesn't show it. Make sure you published the site after the AI built the blog pages. Then reload the page.
    A post's address shows your 404 page. The post isn't published, or its slug changed. Check its Status in the collection.
    The publish dialog lists other items. The post links to items that aren't live yet. They publish together, so the link never points at a missing item.
    You can't delete a post. Something links to it. The delete message names what links to it. Remove those links first.