I've been itching to rebuild my personal site/blog for the last few months. I keep encountering topics that I think would make for good blog posts, but lacked a good place to write about them. I've spent the last few weeks exploring possible CMS options and kept seeing mentions of one called Statamic on /r/Laravel. On Friday, I decided to commit to Statamic and started learning it and building the site you are looking at now.
This is v4 of Drift/Muse. Previous versions of the site ran on top of WordPress, Ghost, and a custom platform I built. The site this replaces – v3, the custom platform – is something I've always been quite proud of, even if I didn't use it. I built it on Laravel and it was fairly simple, barely more than a markdown renderer. But it was fast – on a fresh load, the entire homepage would load in about 150ms and posts, including images, would load in about 250ms. Prior versions of the site were all more than 1000ms so I was quite pleased. I originally felt the markdown format would make it easy for me to write anywhere – all I needed was a text editor and I could upload the markdown file later, right? Unfortunately, including images was more difficult than I expected and I was fairly limited from a styling standpoint.
I've seen the name Statamic mentioned on /r/Laravel and even Hacker News for about 2 years. I was initially interested because it was Laravel-based and I'm primarily a Laravel engineer, but some time with October CMS soured me on that aspect. I've seen it mentioned more and more recently lately though and I decided to give it another look this weekend.
What makes Statamic different from Ghost and WordPress and other blog platforms is what made v3 of my site interesting - it's a flat file system. That means there is no database and all of the content and settings are just stored in YAML files. As a result no database queries, it's lightweight and fast (although not as fast as v3) while still offering most of the niceties you would get from Ghost or WordPress.
Let's review the pros and cons of Statamic.
Pro: The first thing to highlight is that it is pretty easy to learn – both as an editor and as a programmer. This site is the culmination of about 14 hours – 3 hours reading documentation and playing with the Blogo Starter Kit and 11 hours building my own schema and site. Going from 0 knowledge to a working, admittedly simple, custom site in under 2 working days is pretty incredible.
Pro: The schema (Statamic calls them Blueprints) building experience is okay, but not great. It's similar to DatoCMS or Contentful, but you can also see the actual schema files sitting in your application files after you're done editing them (like with Sanity). The benefit is two-fold: everything is easily exposed to you and if you want to copy the settings from one schema to another, it takes seconds not minutes.
Con: Unfortunately, the actual schema creation UX is a little cumbersome due to the sheer number of options to go through.
Pro: One thing I was very pleased to see is schema definition changes don't necessarily lose you content. This is something I battled with on Sanity – if you replace a field (e.g. changing a text field to a rich text field), you either have to be accept you'll lose content or write a migration to save it. Statamic, on the other hand, will do its best to save your content. For example, switching from Markdown to Bard (their block editor) will retain the content, but not the formatting. Not perfect, but better than others.
Statamic allows you to use two different templating engines – their first-party Antlers engine or Laravel's Blade. I suspect you could use others, like Twig, but they don't have first party support. I elected to use Antlers – largely because I dislike Blade.
Pro: If you're proficient with Handlebars or Twig, Antlers should feel mostly familiar. You'll feel right at home writing {{ content }}
all over. And while it's different, including sub-templates via {{ partial 'partials/pagination' }}
doesn't take much to get used to.
Con: I dislike how it handles loops. Whereas in Twig, you would do this:
{% for post in posts %}
<h2>{{ post.title }}</h2>
<p>{{ post.content }}</p>
{% endfor %}
in Antlers, you do:
{{ posts }}
<h2>{{ title }}</h2>
<p>{{ content }}</p>
{{ /posts }}
{# OR #}
{{ posts as="post" }}
<h2>{{ post.title }}</h2>
<p>{{ post.content }}</p>
{{ /posts }}
I'm a big proponent of verbose code and its lack of keyword or verb to describe that that action is in fact looping through an array makes reading the code a little difficult. I also dislike that it tends to use nouns to describe actions. For example, loading another template is done via {{ partial 'path/to/partial' }}
instead of something like Twig's {% include 'path/to/partial' %}
.
Bard is the Statamic's block editor. Out of the box, it just behaves as a rich text editor. I added two custom blocks to mine: a code block that gets used automatically highlighted by Highlight.js and an Image block that includes a caption.
Pro: The rich text portion of it works about as well as any other editor I've used. It's not perfect, but it is certainly good enough.
Pro: Building blocks ("Sets") out is fairly easy – the schema is done entirely in the Control Panel. Add an Antler view for it and it's ready to go. It is possible to execute PHP with it as well, but I haven't dug that far into it yet.
Con: The blocks aren't WYSIWYG. Instead, you get a form in the middle of the editor content. This might be something that can be customized (as much of the Control Panel is) but it's not quite as nice as WordPress or Concrete or any number of other CMS editors that do things like embed an image directly in the content.
I'm not going to label the pricing a pro or a con. It's $275/site and that comes with a year of updates; further update support costs $65/year. It also has a generous free plan if you're a solo editor or don't need drafts/revisions. And you'll need to host it yourself.
Compared to WordPress, Ghost, and October, this is quite expensive if you need the pro features. However, Contentful starts at $300/month. Sanity – which has a very generous free tier – is $15/user/month. Dato is $149/month. It's still on the cheap side, even if it's not free.
I ended up paying the $275 and also spent a further $55 on the SEO Pro addon. I don't mind supporting the devs, especially with how much time it feels like they saved me.
So far, I'm impressed with Statamic. I'm hoping that the improved editing experience and ease of modification will enable me to write more frequent content for this site.
The codebase – minus content, for now – for this site is available at jjanusch/jjanusch.com.