Moving this blog from Grav to Symfony
If you are reading this, the blog is no longer running on Grav. It took me a while to decide, because Grav did nothing wrong.
What I liked about Grav#
Grav is a flat-file CMS. A post is a folder with a markdown file and its images, there is no database, and the admin is a plugin you can leave out. I could write a post in my editor, commit it and be done. For a personal blog that is hard to beat, and it is the reason this blog lasted as long as it did.
It also taught me a lot. I wrote a Grav plugin and added Webpack Encore and TypeScript to it, just to see if it could be done.
What started to bother me#
Nothing big, just a lot of small things. The blog needed about fifteen plugins: archives, comments, feeds, search, sitemap, related pages, a contact form and so on. Each one has its own configuration and its own idea of how things should work, and when I upgraded to PHP 8 one of them crashed the whole site.
And every time I wanted something that was not a plugin yet, I ended up writing PHP for Grav that I would have written in Symfony in half the time, because Symfony is what I use every day. Real comments with moderation, two-factor login for the admin, an audit log of who changed what, tests, a CI pipeline that checks accessibility. All of that is simple in Symfony and a project of its own in Grav.
So the reason is not that Grav was bad. I wanted a blog that can grow like my other projects do.
What I kept#
The content. The posts still live in a git repository, in the same folders Grav used (item.en.md, item.fr.md, the images next to them). The site follows that repository and imports it, so writing a post is still "add a folder and push". The old URLs redirect to the new ones, and the look is the same.
I wrote an import command for the move. It read 40 posts, 71 translations, 2 pages and 73 images, and running it twice gives the same result.
What got easier#
- Editing in the browser. The admin has a markdown editor with a live preview, and a save is a commit in the content repository.
- Comments are mine now, with moderation, instead of a third party script.
- No Node build. The CSS is plain CSS and the page is a lot lighter than before.
- Tests and CI. Every change runs a few hundred tests and a Lighthouse check before it reaches staging.
What got harder#
I will not pretend it is simpler. Grav was one container and some files. Now there is a database, a message queue for the background work, and a synchronisation step between git and the database. When something breaks there are more places to look, and I broke a few of them on the way (the post you are reading was first tested on staging because of that, as a draft only I could see).
I am fine with that trade. I know where everything is, and adding a feature is no longer a question of finding the right plugin.
If you run Grav and it works for you, keep it. It is a good piece of software.
Comments
There are no comments yet. Be the first to write one.
Write a comment