Download the newest Hugo release.
$ VERSION='0.153.1'
$ cd /tmp
$ wget https://github.com/gohugoio/hugo/releases/download/v${VERSION}/hugo_extended_${VERSION}_linux-amd64.deb
$ apt install ./hugo_extended_${VERSION}_linux-amd64.deb
$ hugo version
Hugo documentation.
$ hugo new site fromdual -f toml
Congratulations! Your new Hugo site was created in /home/oli/fromdual_devel/website_2.0/fromdual.
Just a few more steps...
1. Change the current directory to /home/oli/fromdual_devel/website_2.0/fromdual.
2. Create or install a theme:
- Create a new theme with the command "hugo new theme <THEMENAME>"
- Install a theme from https://themes.gohugo.io/
3. Edit hugo.toml, setting the "theme" property to the theme name.
4. Create new content with the command "hugo new content <SECTIONNAME>/<FILENAME>.<FORMAT>".
5. Start the embedded web server with the command "hugo server --buildDrafts".
$ cd fromdual/
$ hugo new theme fromdual
$ echo "theme = 'fromdual'" >> hugo.toml
$ hugo new content test.md
$ hugo new content foo/test.md
Currently we have serious troubles with rendering Hugo sites. This happens with version v0.133.0:
$ hugo version
hugo v0.133.0-c9777473d1369f812d727a6c07dc57ad7be7bf62+extended linux/amd64 BuildDate=2024-08-17T19:57:41Z VendorInfo=gohugoio
See Hugo issue https://github.com/gohugoio/hugo/issues/12786[12786^]
Version 0.128.2 and 0.132.2 workes like a charme at least for me. Some workarounds that helped sometimes:
$ rm -rf public/*
$ hugo --printUnusedTemplates --printPathWarnings --environment=production
$ hugo server --buildDrafts --cleanDestinationDir --disableFastRender -cq --ignoreCache --logLevel=info --printUnusedTemplates --printPathWarnings --environment=production
To render your site:
$ rm -rf public/*
$ hugo server --buildDrafts --cleanDestinationDir --disableFastRender
The you can access your site as follows (do NOT use 127.0.0.1!):
$ git init .
$ git add *
$ git commit -m 'Inital version'
It is important where you are in the directory hierarchy! Precedence from top down:
$ find . -name hugo.toml
./config/_default/hugo.toml
./hugo.toml
./themes/fromdual/hugo.toml
$ hugo config | grep --color outputs -A7
[outputs]
home = ['html']
page = ['html', 'rss']
rss = ['rss']
section = ['html', 'rss']
taxonomy = ['html', 'rss']
term = ['html', 'rss']
{{ $site := page.RegularPages }}
{{ $site := .Page.RegularPages }}
{{ $site := site.RegularPages }}
{{ $site := .Site.RegularPages }}
{{ $general := site.GetPage "general" }}
{{ range $general.RegularPagesRecursive }}
...
{{ end }}
{{ range where .Site.RegularPages "Section" "posts" }}
...
{{ end }}
{{ range .Children }}
{{ range $site }}
...
{{ end }}
{{ $object := . }}
{{- with resources.Get "..." }}
...
{{ end }}
{{ $object := . }}
{{ $object := page.Title }}
{{ $object := page.Type }}
{{ $object := page.Weight }}
{{ $object := page.WordCount }}
{{ $object := page.Ancestors }}
{{ $object := page.Parent }}
{{ $object := page.CurrentSection.Title }}
{{ $object := page.LinkTitle }}
{{ $object := page.Prev }}
{{ $object := page.Path }}
{{ $object := .Site.Title }}
{{ $object := .Site.AllPages }}
{{ $object := .Site.Home }}
{{ $object := .Site.Menus }}
{{ $object := index .Site.Sections 2 }}
{{ $object := .Site.Title }}
{{ $object := .Site.Taxonomies }}
{{ $object := .Site.Menus }}
{{ $object := site.Menus.main }}
{{ $object := index .Site.Menus.main 3 }}
{{ debug.Dump $googleimg }}
{{ . | debug.Dump }}
{{ debug.Dump . }}
{{ . | debug.Dump | jsonify (dict "indent" " ") }}
{{ range .Site.Menus.main }}
{{ if .HasChildren }}
{{ range .Children }}
{{ . }}
{{ end }}
{{ end }}
{{ end }}
{{ $object := . }}
{{ printf "value: %v\n" $object }}<br>
{{ printf "value: %+v\n" $object }}<br>
{{ printf "value: %#v\n" $object }}<br>
{{ printf "type: %T\n" $object }}<br>
For Hugo performance tuning see here.