Skip to main content
  1. Tags/

Hugo-Theme

2023


Git submodules and newly cloned repositories

·1 min

As a reminder for my future self: If one clones a repository to a new location, the submodules are not cloned automatically. They need to be initialized and updated once, in order to show the proper content.

git submodule init
git submodule update

If the theme is a submodule and the customizations are in a different branch, one needs to switch to that particular branch as well. D’oh!

git checkout live

Keep the hugo theme up-to-date

·1 min

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: