Getting started

Prerequisites

Firstly, ensure you have installed the extended version of Hugo. See installation steps from Hugo's official docs.

Getting up and running

Read the prerequisites above and verify you're using the extended version of Hugo. There are at least two ways of quickly getting started with Hugo and the VMware Clarity theme:

Generate a new Hugo site and add this theme as a Git submodule inside your themes folder:

1hugo new site yourSiteName
2cd yourSiteName
3git init
4git submodule add https://github.com/chipzoller/hugo-clarity themes/hugo-clarity
5cp -a themes/hugo-clarity/exampleSite/* .

Then run

1hugo server

Hurray!

Option 2 (Great for testing quickly)

You can run your site directly from the exampleSite. To do so, use the following commands:

1git clone https://github.com/chipzoller/hugo-clarity
2cd hugo-clarity/exampleSite/
3hugo server --themesDir ../..

Although, option 2 is great for quick testing, it is somewhat problematic when you want to update your theme. You would need to be careful not to overwrite your changes.

Option 3 (The new, most fun & painless approach)

This option enables you to load this theme as a hugo module. It arguably requires the least effort to run and maintain in your website.

First things first, ensure you have go binary installed on your machine.

1git clone https://github.com/chipzoller/hugo-clarity.git clarity
2cd clarity/exampleSite/
3hugo mod init my-site

Open config.toml file in your code editor, replace theme = "hugo-clarity" with theme = ["github.com/chipzoller/hugo-clarity"] or just theme = "github.com/chipzoller/hugo-clarity".

Hurray you can now run

1hugo server

To pull in theme updates, run hugo mod get -u ./... from the theme folder. If unsure, learn how to update hugo modules

There is more you could do with hugo modules, but this will suffice for our use case here.