Install as a Git submodule
This guide creates a new Hugo site named quickstart and adds the Ananke theme as a Git submodule in themes/ananke. Your repository then records the exact theme commit. To compare this method with a Hugo Module, read Choose an installation method.
Requirements #
- Hugo, in a version that the current Ananke release supports. See Hugo version compatibility. We recommend the latest Hugo release.
- Git.
Check the installed versions:
hugo version
git --versionInstallation #
Create the site and change into its directory:
bashhugo new site quickstart cd quickstart git initAdd the theme as a Git submodule:
bashgit submodule add https://github.com/gohugo-ananke/ananke.git themes/anankeGit clones the theme’s default branch,
main, which contains the latest release.Optional: select a specific release instead, for example v2.23.0:
bashgit -C themes/ananke checkout v2.23.0Select the theme in the site configuration:
bashecho "theme = 'ananke'" >> hugo.tomlCommit the submodule:
bashgit add .gitmodules themes/ananke hugo.toml git commit -m "Add the Ananke theme"Start the development server:
bashhugo server
Check the result #
git -C themes/ananke describe --tagsshows the theme release, for examplev2.23.0.- http://localhost:1313/ shows the site with a dark header bar and the site title. The new site has no content yet.
Stop the server with Ctrl + C.
If the build fails, compare your Hugo version with Hugo version compatibility, and see Troubleshooting.
Clone a site that uses the submodule #
A normal git clone leaves themes/ananke empty. Clone with the submodule:
git clone --recurse-submodules https://github.com/username/reponame.gitIn an existing clone, run git submodule update --init.
Next steps #
- Add a homepage, a post, and a menu: Build your first Ananke site.
- Set your site’s options: Configuration.
- Update the theme later: Update Ananke.