If your website content is not already in a git repo, the navigate to the folder of your Hugo site and run:
git clone https://git.sr.ht/~skyfaller/maxethics-hugo themes/maxethics-hugo
If your website content is already in a git repo, try using a git submodule instead. Inside the folder of your Hugo site run:
git submodule add https://git.sr.ht/~skyfaller/maxethics-hugo themes/maxethics-hugo
After the theme is pulled from the git repository in some manner, edit the config.toml file of your Hugo site to include:
theme = "maxethics-hugo"
For more information read the official setup guide of Hugo.
We use Hugo Modules to install and update this theme on our infrastructure, rather than using Git submodules or subtrees (between the two, subtrees might actually be better for the casual user). This does add a dependency of a newer installation of the Go language (>=Go 1.14), but may be conceptually easier to understand + maintain than nested Git repositories if you are also storing your website content in a Git repository (as we do).
Sadly, Hugo modules are new and poorly documented. We found this support thread How to add a theme using modules (for beginners) invaluable when getting started.
(Rather than keeping the module info in our config file as suggested in that thread, we use automated tools to put our go module info in a separate file.)
First, at the command line, go to the top level of your project. Initialize your site as a hugo module. To do that, type
hugo mod init and then the url where the site will be deployed (without a trailing slash at the end). For example:
hugo mod init yourname.github.io/sitename
for GitHub Pages user yourname deploying sitename.
In config.toml, add a line:
theme = "git.sr.ht/~skyfaller/maxethics-hugo"
Then use the following command to install our theme as an external Hugo module:
hugo mod get -u
Your site should now be using the latest stable version of our theme. In order to update to the latest stable version of our theme, use the same command again. Then generate your site again using
To modify this theme and test it locally, add the following at the end of your go.mod file:
// To develop locally, uncomment the line below and edit it to point to your local copy replace git.sr.ht/~skyfaller/maxethics-hugo => /home/username/maxethics-hugo
/home/username/maxethics-hugo is the location of your local copy of the Hugo theme. This should not be inside the "themes" folder of your website where Hugo themes were traditionally kept! Put it elsewhere on your computer.
Before contributing, please read our Code of Conduct. It's currently a verbatim copy of
We intend to use SemVer for versioning, but to achieve that we'll have to resist the temptation of 0-based versioning (i.e. permanent beta). For the versions available, see the tags on this repository.