🙀 Custom theme across few websites - how do you manage?

I love Grav so much (thanks Grav Team) that I am running it across few of my websites:


https://focusasia.xyz/
https://hustlerbundle.com/ (soon to be ready, right now just “hello world”)

The issue I have is managing the custom theme I am developing across all these sites.

Right now it’s a pain in the ass because when I introduce a change to one site (CSS styling, HTML etc.), I need to manually add these to the other (on top of that, remembering what changes were made where is terrible, even if you manage through GIT). Of course, landing/root page will look different for each for obvious reasons.

Additionally: Will it be possible to develop/maintain a theme that will keep same structure but will be a bit different in details? For example, on one website I would like to keep a sidebar for blog section but for the other no sidebar.

An option is to use a Git repository for your theme. On every push to that repo, a post-commit hook will “push” the changes to your sites. There are many ways to do that, you can google for them.

As for changing something across the sites, you can have site.yaml variables that change how the theme renders, using for example {% if config.site.something == 'xxx' %} checks. The same can apply to page properties, as well, to change something on a page-level.

Or, you can have a base theme, and have your themes on each different site extend the base one, so you have base styles, and custom ones.