Choose an installation method
You can add Ananke to a site in two ways. Both give the same theme and the same site; they differ in how the theme gets into your project and how you update it.
- Hugo Module: Hugo downloads the theme through Go’s module system into a cache outside your project. Your project records the exact release in
go.modandgo.sum. - Git submodule: Git places the theme repository in
themes/anankeinside your project. Your repository records the exact theme commit.
We recommend the Hugo Module method. One command updates the theme or selects a release, and the version is a readable line in go.mod.
Hugo’s quick start installs Ananke as a Git submodule. That method works well too. You can change from one method to the other later.
[!NOTE] Do you already use Ananke from the old
theNewDynamicrepository? Read Upgrade from theNewDynamic to gohugo-ananke to update your references togithub.com/gohugo-ananke/ananke.
Compare Hugo Module and Git submodule #
| Method | Advantages | Disadvantages | Sample repository |
|---|---|---|---|
| Hugo Module (recommended) | Update or select a release with one hugo mod get command. The version is visible in go.mod. No theme files in your repository. | Requires Go. The first build downloads the theme, so it needs network access. | Hugo Module template |
| Git submodule | Needs only Git. The theme files are in your project, so you can read them next to your site. | Every clone and deployment must fetch the submodule. Updates need Git commands in the submodule and a commit in your site. | Git submodule template |
Neither method updates the theme by itself. Your site keeps its release until you update it; see Update Ananke.
With either method, do not edit the theme files. Change the theme behaviour from your own project instead; see How Ananke configuration works.
Back to contents