Skip to main content
  1. Posts/

Keep the hugo theme up-to-date

·1 min
a robot wearing a shirt with the text HUGO on it rearranges a layout on a print press, photo realistic

I found out that my current setup doesn’t allow for easy theme updates by the author, since I just cloned the theme folder into my hugo project ⊙﹏⊙

But thanks to Adam and his introduction to gits submodule function I was able to work around this.

Create repositories #

  • First I created a repository for my hugo project
  • Then I created a fork of my current theme Terminal
  • The theme was then embedded as submodule in my hugo project and received a second git repository as upstream source (this is the magic function right here)
git submodule add -f https://github.com/<user>/hugo-theme-terminal.git themes/terminal
git remote add upstream https://github.com/panr/hugo-theme-terminal.git
  • I also followed Adams advise and moved my theme customizations to a different branch

Get updates from the theme author #

My workflow for theme updates now looks like this:

  • Changes to my customized theme will be added on the live branch
  • Official updates to the theme will be synced to the master branch and merged to live on demand
# from ./theme/terminal
git checkout master
git pull upstream master
git push origin master

git checkout live
git merge master

I’m still not using Github pages for publishing, I kind of can’t let go of my trustworthy VPS.

jwb
Author
jwb
Something-ops during the day, nowadays mostly asleep during the night.