Using Bolt

Warning: This post is over a year old. The information may be out of date.

I’ve moved the site to Bolt as a CMS - so I can start writing some posts about things that interest me - who wants to write yet another blog system, right?

Previously the site was essentially just static pages, I was playing around with some stuff in Laravel, but for the pages that were here it wasn’t necessary.

I’ve wanted to start writing some posts on things I’m tinkering with so instead of writing yet-another-blog-system I looked for a CMS to use. 

ExpressionEngine is nice (it’s what we use at work), but license cost is expensive for just me. WordPress would probably do, but I’m not a fan of writing themes / the style of coding required for it. I could have written a basic blog system myself, but I really didn’t want that.

Recently a friend had told me about Bolt, a CMS that claims to be easy & straightforward to setup, configure & work on - so I got it running on Apache to see what it was like.

I loved it. The customisation was great, and twig for templates! Oh my…

It looks to be written very nicely, decent coding standards and well thought out.

There was one (little) problem though, the server the site would sit on runs Hiawatha - a lesser known web server (that I’m a huge fan of, I’ve done talks on it).

Because of this, it meant that the URL re-writes listed in the Bolt Installation instructions would need to be converted from the nginx listing there, to a Hiawatha UrlToolkit.

After a bit of fiddling, some trial and error, this is the toolkit I’ve come up with:

UrlToolkit {
        ToolkitId = boltcms

        # Allow things through the CMS to go through index.php and work correctly
        Match ^/bolt/(.*) Rewrite /index.php
        Match ^/async/(.*) Rewrite /index.php
        Match ^/thumbs/(.*) Rewrite /index.php
        Match ^/app/classes/upload(.*) Rewrite /app/classes/upload/index.php

        # Cache static assets for 2 weeks
        Match ^/.*\.(css|eot|gif|htm|html|ico|jpeg|jpg|js|otf|pdf|png|ps|psd|svg|swf|ttf|txt|woff|woff2)(/|$) Expire 2 weeks
        Match ^/.*\.(css|eot|gif|htm|html|ico|jpeg|jpg|js|otf|pdf|png|ps|psd|svg|swf|ttf|txt|woff|woff2)(/|$) Return

        # Deny files we don't want people seeing (will 403 error)
        Match /app DenyAccess
        Match /vendor DenyAccess
        Match /CodeSniffer DenyAccess
        Match .db$  DenyAccess
        Match .yml$ DenyAccess
        Match .twig$ DenyAccess
        Match .md$ DenyAccess
        Match .dist$ DenyAccess
        Match .lock$ DenyAccess

        RequestURI exists Return
        Match .* Rewrite /index.php
}

Using this seems to work nicely so far.

I’ll list a few things I love about Bolt, then a few things I don’t based on my initial fiddling with it:

Things I love:

  • YAML, oh the YAML for config
  • Editable content types
  • Custom fields for those content types
  • Twig templating
  • A really nice, easy to use CMS (and it’s responsive, now that’s cool!)
  • The file stack feature

Things I’m not so keen on:

  • [Update]: Originally, I had YAML for config listed here as well because config files were publicly visible unless denied by the webserver through various rules (like the ones above) - but in addition to the regular installation of bolt that can be done there’s a version with a composer installer tool that puts the system / app type files outside the public web space. I’ve since changed the site to use that installation (making a lot of the above rules not needed anymore). So that’s nice, it’s just a shame it’s not more prominent on the site.
  • ​No native hierarchical menu editor (though there is an extension, but I’ve not played with it much)
  • Routing / Pretty URLs (it’s semi-related to the above point)
  • This is because the routing isn’t fully custom, you need a singular content type to be the first part of the URL unless you do some trickery. For example, by default, an about page in the “Pages” content would be /page/about whereas you may just want /about - but this can be worked around as you can put in custom routes and other such things. I’m not that experienced with Bolt yet so I may be missing something obvious too.

Other than that, Bolt’s been really nice to work with so far from a developer perspective. I’ve still got a few things I need to implement, such as a ’list’ page for blogs (currently only the latest few will appear at the bottom on the homepage) but that’ll come soon.