How to build and use the official Hugo docs site locally

I’m trying to build the site for the official Hugo documentation https://gohugo.io/overview/introduction/ locally. I’m doing this to learn more about Hugo and I’m especially interested in building a site with a similar navigation and theme.

I’ve cloned https://github.com/spf13/hugo/

When I run hugo server from the docs directory I get a tons of errors:

$> hugo version
Hugo Static Site Generator v0.16 BuildDate: 2016-06-06T14:37:59+02:00
$> hugo server

Started building site
ERROR: 2016/12/12 00:16:26 general.go:222: Error while rendering taxonomy tag: template: /Users/karl/tmp/hugo/hugo/docs/layouts/_default/baseof.html:2:8: exec
uting "main" at <.Content>: Content is not a field of struct type *hugolib.Node
ERROR: 2016/12/12 00:16:26 general.go:222: Error while rendering section meta: template: /Users/karl/tmp/hugo/hugo/docs/layouts/_default/baseof.html:2:8: exec
uting "main" at <.Content>: Content is not a field of struct type *hugolib.Node
ERROR: 2016/12/12 00:16:26 general.go:222: Error while rendering section troubleshooting: template: /Users/karl/tmp/hugo/hugo/docs/layouts/_default/baseof.htm
l:2:8: executing "main" at <.Content>: Content is not a field of struct type *hugolib.Node
ERROR: 2016/12/12 00:16:26 general.go:222: Error while rendering section overview: template: /Users/karl/tmp/hugo/hugo/docs/layouts/_default/baseof.html:2:8:
executing "main" at <.Content>: Content is not a field of struct type *hugolib.Node
ERROR: 2016/12/12 00:16:26 general.go:222: Error while rendering section community: template: /Users/karl/tmp/hugo/hugo/docs/layouts/_default/baseof.html:2:8:
 executing "main" at <.Content>: Content is not a field of struct type *hugolib.Node

.
.
.

ERROR: 2016/12/12 00:26:30 template.go:131: template: partials/footer.html:3:86: executing "partials/footer.html" at <.GitInfo>: GitInfo is not a field of struct type *hugolib.Page in partials/footer.html
ERROR: 2016/12/12 00:26:30 template.go:131: template: partials/footer.html:3:86: executing "partials/footer.html" at <.GitInfo>: GitInfo is not a field of struct type *hugolib.Page in partials/footer.html
0 draft content
0 future content
206 pages created
0 non-page files copied
0 paginator pages created
0 groups created
58 tags created
in 777 ms
Watching for changes in /Users/karl/tmp/hugo/hugo/docs/{data,content,layouts,static}
Serving pages from memory
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

Do I need to use another version of hugo?

~ karl

You need to build Hugo from the latest source. You can build the latest dev release with Hugo from two releases ago (0.16).

Thank you! I’m totally new to Go and after struggling a little with setting up $GOPATTH I managed to built the lastest version of hugo from source.

$> which hugo-18-dev
/usr/local/bin/hugo-18-dev
$> hugo-18-dev version
Hugo Static Site Generator v0.18-DEV BuildDate: 2016-12-12T01:20:28+01:00

Now the official documentation site build without error :slightly_smiling:

$> git rev-parse HEAD
83c6806576a27942d49ff0cf81712b14bfda43e0
$> cd docs/
$> hugo-18-dev server
Started building sites ...
Built site for language en:
0 draft content
0 future content
0 expired content
205 regular pages created
72 other pages created
0 non-page files copied
0 paginator pages created
0 groups created
58 tags created
total in 490 ms
Watching for changes in /Users/karl/tmp/hugo/hugo/docs/{data,content,layouts,static}
Serving pages from memory
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop