Using Pico as a minimal blogging solution

I was on the search for a minimalistic blogging experience. I have found it in PicoCMS. Here's how I build my minimal blog on it.

A few months ago I started to go more bare bone. A minimalist approach to software, so to say. So that included my personal website. It needed it to function and be convenient, yet simple enough so I knew exactly what was going on at any point.

Pico is a so-called 'flat file CMS'. You drag and drop .md files in a folder and it'll show on the website.

No database nonsense and full markdown support. Just the way I like it.

How I setup Pico as a blog

Initially, Pico is not meant as a blogging platform. However, it makes it simple to make it a blog out of it.

Instead of displaying the different pages in the navigation menu, I made it display the pages as a list.

I rewrote how Pico displays its content. The following code does two things:

  1. It'll determine whether I am on the front page, and display the ''. (If it is not the front page, it will display the article.)
  2. List all other markdown files marked with 'Type: post' in the directory /content/. (That way I can exclude pages from the 'articles list'.)
 <div class="wrap">
            {% if is_front_page %}
                {% if not(page.url == base_url ~ '/') %}
                    {{ content }}
                    <div class="blog-articles">
                        {% for page in pages | sort_by("time") | reverse %}
                            {% if page.meta.type == 'post' %}
                                    <a href="{{ page.url }}"></a>
                                        {{ page.title }}
                                    <p class="excerpt">{{ page.description }}</p>
                            {% endif %}
                        {% endfor %}

                {% endif %}
            {% else %}
                <article class="post">
                    <a href="./" class="back-link">Back link</a>
                        <h1>{{ meta.title }}</h1>
                        <div class="post-meta">
                            <time>Published on
                                {{ }}</time>

                    <div class="post-content">
                        {{ content }}
            {% endif %}



Setting up a sitemap.xml

The plugins work the same way as articles. One php file in the plugins folder and done: I have an automatic generated sitemap on

Here's the PHP script I used (written by DaveKin on Github):


class PicoXMLSitemap extends AbstractPicoPlugin
    private $is_sitemap = false;

    public function onRequestUrl(&$url)
        if($url == 'sitemap.xml') {
            $this->is_sitemap = true;

    public function onPagesLoaded(&$pages, &$currentPage, &$previousPage, &$nextPage)
            header($_SERVER['SERVER_PROTOCOL'].' 200 OK');
            header('Content-Type: application/xml; charset=UTF-8');
            $xml = '<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="">';
            foreach( $pages as $page ){
                $xml .= '<url><loc>'.$page['url'].'</loc>';
                    $xml .= '<lastmod>'.date('c', $page['time']).'</lastmod>';
                $xml .= '</url>';
            $xml .= '</urlset>';
            header('Content-Type: text/xml');


That's it. That's what I am running now.

Things that are still left to do:

  1. Pagination
  2. RSS feed implementation
  3. SEO optimisation
  4. Open Graph images for sharing articles
  5. Support for more pages