Running Hugo Academic Theme Locally

Overall, I am very happy that I moved from WordPress to a static site on Hugo. I also think the Academic theme is a great personal site theme and I’m alway stumbling on new people using it. However I’ve run into two really frustrating issues that I hope that I have resolved for good:

  1. I following the recommended installation instructions of building with one click on Netlify, but when I would clone the project locally, it would not install the theme submodule. This would prevent my local hugo sever from building until I hackishly downloaded a local copy of the them myself.
  2. Similarly, due to my hacked setup, updating the theme proved impossible. Both times that I have updated the theme I did so by setting up fresh versions of the repo then re-loading content from the last version. Not ideal.

I think I have resolved both problems just by learning git a little better. This time after creating a fresh version of the repo with the latest theme, I cloned with the --recurse-submodules flag. This brought down the theme files from the start and my local hugo server built no problem. Plus I think this will allow me to use the theme’s update instructions.

Update

I successfully updated the theme for the first time without having to just rebuild all the content against a fresh site skeleton. Steps:

  1. Ran git submodule update --remote --merge then had to add themes folder in git
  2. Applied all the breaking and config changes
  3. Upgraded Hugo on my local machine
  4. Resolved an issue in a template change that I had overridden

The first update still took a bit longer to execute than I had hoped, but mostly that was due to the learning curve and updating multiple versions and having to apply multiple blocks of breaking/config changes.

Recently, I updated up just a single version by:

  1. Navigated to the theme directory via cd themes/academic
  2. Checked out the specific version (in this case 4.8.0) with git checkout v4.8.0
  3. Applied the breaking and config changes for the newest version