A minimal Hugo site used to test themes in isolated branches.
git checkout main
git checkout -b <theme-name>git submodule add <theme-repo-url> themes/<theme-name>theme = "<theme-name>"hugo server -DAfter switching branches or cloning:
git submodule update --init --recursivegit submodule deinit -f themes/<theme-name>
git rm -f themes/<theme-name>
rm -rf .git/modules/themes/<theme-name>
git commit -m "Remove <theme-name> submodule"| Task | Command |
|---|---|
| New branch | git checkout -b <theme> |
| Add submodule | git submodule add <repo-url> themes/<theme> |
| Update hugo.toml | |
| Init after switch/clone | git submodule update --init --recursive |
| Start server | hugo server -D |