Skip to content

Kirby 4.2.0

Blog

A simple blog and articles setup

Blog

/site/blueprints/pages/blog.yml
title: Blog
icon: 📚

columns:
  left:
    width: 1/2
    sections:
      drafts:
        extends: sections/articles
        label: Drafts
        status: draft

      unlisted:
        extends: sections/articles
        label: In Review
        status: unlisted

  right:
    width: 1/2
    sections:
      listed:
        extends: sections/articles
        label: Published
        status: listed

Predefined section for reusage

/site/blueprints/sections/articles.yml
type: pages
label: Articles
info: "{{ page.date.toDate('d.m.Y') }}"
template: article
empty: No articles yet
sortBy: date desc

Result

Single article

/site/blueprints/pages/article.yml
title: Article
num: '{{ page.date.toDate("Ymd") }}'
icon: 📖

status:
  draft:
    label: Draft
    text: The article is still in draft mode. It can only be seen by editors with panel access.
  unlisted:
    label: In Review
    text: The article is online and can be visited with the direct URL. The team must still give the final go to publish it.
  listed:
    label: Published
    text: The article is online and listed in the blog

columns:
  main:
    width: 2/3
    fields:
      text:
        type: textarea
        size: large

  sidebar:
    width: 1/3
    # here we add two sections: a meta fields section and a files section to upload files we can select from in the heroImage field
    sections:
      meta:
        type: fields
        fields:
          heroImage:
            type: files
            max: 1
          date:
            type: date
            time: true
            default: now
          author:
            type: users
          tags:
            type: tags
      files:
        type: files

Result

Cookbook

If you want to find out more about creating a Kirby-powered blog, read our full cookbook recipe.