Developing a theme in parallel to the site on localhost

I used a slightly modified fork of minimal-mistakes as the theme for a couple of sites that I manage. They don’t get a bunch of updates, but enough to make me want to improve my workflow. I keep the theme and my sites separated because I want to minimize pain if the theme is updated upstream by the maintainer. That hasn’t happened in a while, but it used to be a much more common occurrence as they were adding features.

My sites use separate _config.yml and _dev.yml files with Github Actions for deploying to production. I have jekyll-remote-theme pointing to my fork. All that works for both dev and production.

Occasionally, I need to create a new layout or tweak the CSS in the theme itself and it is a painful process. Because I’m using the remote theme, I end up making the changes that I think I want to the theme and push the changes to the Github repo. Then, I kill the localhost process for building, clear the cache, and restart the server. It pulls the remote theme into the cache and uses it. The problem of course, is this takes maybe 10 minutes each time. I spend a lot of time in the inspector, modifying the output to see what might work, rather than editing in VS Code, saving, letting the build happen and getting the results 20 seconds later.

I suppose my question is “Is there an easy way to use jekyll-remote-theme with a path to a local folder?” I tried to use a local file url, but it failed. It seems it really wants github-account/repo-name as the only form of input.

Am I some weird corner case? How do Jekyll pros keep their themes and sites separate and still manage to get work done?

This pro never touched themes. Allowing ‘others’ to change my website? No thanks. I make bespoke website, so reuse of themes does not exist in my world. If it happens I copy and paste the files required. Zero dependencies!

This pro never touched themes

I understand your point and I’ve built sites where the theme and content are the same project. In fact, a work project I manage does this and it even has some of your code in it. :slight_smile:

In this case, I prefer to have the separation of content and display to make updates across all the sites easier. My theme is based on an existing theme that I merge upstream changes into. I do review the changes, but the Minimal Mistakes project has good QA and I trust their releases. The theme hasn’t changed in over a year, so that’s not the problem. It’s when I want to add new features or styling to my version of it. It’s not the worst experience, but I know I can do better.

1 Like

If you make a copy of the file you’re modifying in the local directory, that’ll override whatever the remote theme provides; you could tweak your local copy until you’re happy, and then merge the changes just once into the upstream remote?

Oh. I’m not sure why I didn’t realize that would work. I figured it was an all-or-nothing thing.

I will definitely try that and report back.

1 Like