Configure Theme

Configure Theme

Here we look at what it takes to “hook” an external theme to your project.

Create site

hugo new site hugo-guide --format=yaml
cd hugo-guide

Start using theme

We will be using Hextra theme. Configure Hextra theme via module.

  • Initialize hugo module:
../hugo-guide$
hugo mod init github.com/username/my-site
  • Add hextra theme
hugo mod get github.com/imfing/hextra

Then go.mod first line will be module github.com/username/my-site
Will need to change that later to real repo for production.

  • Add to your hugo.yaml
module:
  imports:
    - path: github.com/imfing/hextra

Preview site

  • Create content pages for the home page and the documentation page:
hugo new content/_index.md
hugo new content/docs/_index.md
  • Preview site
hugo server -D   # OR hugo server --buildDrafts --disableFastRender

Update theme

Subsequently from time to time you will need to run:

hugo mod get -u github.com/imfing/hextra