An update for my blog was long over due, but now it is finally here.
I have been working on an update for this blog for a long time. It what should have been an easy update of the theme ended up taking my up different streams before settling.
Previously this blog was hosted on a Drupal 7 site, which worked great. I had it set up how I wanted it and tuned for performance. Nonetheless, Drupal is a big framework to work with for a simple blog, and in the end it gave me some issues when I tried to update the theme.
It's no secret that I'm not a front end developer. I can work with HTML and CSS, of course, but setting up a site that looks good and it responsive with all the bells and whistles is not my strong suit. Add to this that the HTML structure needs to fit into the templates that Drupal provides and the difficulty of the task increases. After spending a few months implementing a new theme in the current Drupal site I decided to go a different route.
At first I looked into Symfony, Silex, and Laravel, which all PHP frameworks that I wanted to get familiar with. I figured it was time to get with the times and learn a more modern framework and anything I would learn from Symfony would also be beneficial for any future work with Drupal 8, which has incorporated several Symfony components. However, both Symfony and Laravel come with a learning curve which to away my focus from the new theme, and this new way of building a site presented me with many challenges that I wasn't sure on how to handle. I have previous experience with Silex but the project has been discontinued since Symfony 4 now allow for an equally lightweight site routing with the Flex system.
After looking at the established frameworks I looked into building my own site from scratch using only PHP. I figured it would be a great learning experience. But, as I knew from the start, you shouldn't build everything from scratch yourself. Even a simple blog needs common functionality, such as user management, session handling, security, database management, template engine. The components take time to perfect and I cannot ensure the security and performance of these on my own.
My next step was to look into static site generators. A static site generator moves the content management avoid from the web server. The content is generated on a remote (local) machine and pushed to the web server. The web server will then just serve the static HTML pages. This way there are no forms for login or content creation that can be hacked, or databases that can be corrupted. There is no logic that can cause performance issues. I looked into Jekyll (used on Github Pages), Sculpin, and Spress. The latter two are built on PHP, which is a huge benefit if I am to debug or add plugins or patches. Jekyll is built on Ruby. They all require that content is written in Markdown, which is great, because all my posts are already stored in Drupal as Markdown using the Markdown filter module, so migration would be easy. I ended up using Sculpin, primarily because I know others who use it.
I have now set up a simple Bootstrap template in Sculpin and migrated my blog posts and I like it! It consists of generated paginated list of posts, post view, archive, and tag and category lists. I also kept my about page that was also on my previous site. The new setup is performing very well already, but I would like to make a more thorough stress test on the site as I have done previously.
The HTML and CSS could also be better both visually and structurally. It's ok for now, and when I want to change anything the layout and styling is confined to a few HTML and CSS files, so it will be easy to update - well, easier that with Drupal. (I have my eyes on Material.io.)