Install the Go compiler, which is found in Fedora’s own repository:
$ sudo dnf install go
Set $GOPATH
in your .bashrc
or .zshrc
, and add its bin
folder to your
$PATH
:
$ echo "\nexport GOPATH=~/go\nexport PATH=\$PATH:~/go/bin" >> ~/.zshrc
$ source ~/.zshrc
A pre-built version of Hugo cannot be found within Fedora’s repository. So we have to build it from source instead. To download the latest released version of Hugo from Github we will use gopkg.in, to avoid installing from master which might not be stable:
$ go get -v gopkg.in/spf13/hugo.v0
If successful, it should now be possible to run Hugo:
$ hugo.v0 version
Hugo Static Site Generator v0.19-DEV linux/amd64 BuildDate: 2017-01-21T12:48:27+01:00
(I don’t know why it says v0.19-DEV
though, since the source code in
~/go/src/gopkg.in/spf13/hugo.v0/
seems to correspond to 0.18.1 in my case.
If you also have ReStructuredText source files, install python-docutils
:
$ sudo dnf install python-docutils