Devlog – converting this WordPress site to Bedrock itself - Bedrock

submited by
Style Pass
2021-07-04 19:00:08

Yesterday I went on one of those crazy programmer journeys where I worked for 8-9 hours more or less non-stop. In the morning I had a discussion with the crew over at Routify about evolutions in Svelte and this got me inspired to try some new things.

I had been working on Bedrock for a while now in June, adding all kinds of stuff (PostCSS + PurgeCSS support for Tailwind purposes, a separate config for production etc.) and this made me quite familiar with the Bedrock codebase.

However there were still a few parts of the code that were a bit of a mystery to me. There’s server.js which runs an Express server to get your templates on demand while working in Bedrock (avoiding static rebuilds, the way Jekyll used to work) and templates.js which builds the templates when you build a static site. Essentially they do the same, they generate the site, but one of them is at runtime based on a web request and another is when you do a static build. We will get back to this.

The site that you are reading this exact blog post on runs on WordPress (unless you are using a feed reader in which I salute you). I made this choice mostly because Bedrock never supported blogging in the first place.

Leave a Comment