helm-www icon indicating copy to clipboard operation
helm-www copied to clipboard

Update Hugo Install Instructions or Refactor for Hugo v0.93.x Compatibility

Open Timothy-Dement opened this issue 3 years ago • 2 comments

Problem Description

I was going through the README to get set up for a minor documentation fix and hit a snag after brew install hugo.

The current version of hugo is v0.93.3 (as of 08 Mar 2022) and that version is installed via brew:

  • https://formulae.brew.sh/formula/hugo

If hugo serve is run in the helm-www repository root, several errors occur:

> $ hugo serve
--------------
Start building sites … 
hugo v0.93.3+extended darwin/amd64 BuildDate=unknown
WARN 2022/03/08 14:45:27 found no layout file for "HTML" for kind "section": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
ERROR 2022/03/08 14:45:27 render of "page" failed: execute of template failed: template: blog/single.html:5:7: executing "main" at <partial "nav.html" .>: error calling partial: execute of template failed: template: partials/nav.html:30:11: executing "partials/nav.html" at <partial "nav-i18n.html" .>: error calling partial: "/Users/tmdement/Code/helm-www/themes/helm/layouts/partials/nav-i18n.html:21:68": execute of template failed: template: partials/nav-i18n.html:21:68: executing "partials/nav-i18n.html" at <$translation.URL>: can't evaluate field URL in type page.Page
ERROR 2022/03/08 14:45:27 render of "page" failed: execute of template failed: template: blog/single.html:5:7: executing "main" at <partial "nav.html" .>: error calling partial: execute of template failed: template: partials/nav.html:30:11: executing "partials/nav.html" at <partial "nav-i18n.html" .>: error calling partial: "/Users/tmdement/Code/helm-www/themes/helm/layouts/partials/nav-i18n.html:21:68": execute of template failed: template: partials/nav-i18n.html:21:68: executing "partials/nav-i18n.html" at <$translation.URL>: can't evaluate field URL in type page.Page
ERROR 2022/03/08 14:45:27 render of "page" failed: execute of template failed: template: blog/single.html:5:7: executing "main" at <partial "nav.html" .>: error calling partial: execute of template failed: template: partials/nav.html:30:11: executing "partials/nav.html" at <partial "nav-i18n.html" .>: error calling partial: "/Users/tmdement/Code/helm-www/themes/helm/layouts/partials/nav-i18n.html:21:68": execute of template failed: template: partials/nav-i18n.html:21:68: executing "partials/nav-i18n.html" at <$translation.URL>: can't evaluate field URL in type page.Page
ERROR 2022/03/08 14:45:27 render of "page" failed: execute of template failed: template: blog/single.html:5:7: executing "main" at <partial "nav.html" .>: error calling partial: execute of template failed: template: partials/nav.html:30:11: executing "partials/nav.html" at <partial "nav-i18n.html" .>: error calling partial: "/Users/tmdement/Code/helm-www/themes/helm/layouts/partials/nav-i18n.html:21:68": execute of template failed: template: partials/nav-i18n.html:21:68: executing "partials/nav-i18n.html" at <$translation.URL>: can't evaluate field URL in type page.Page
Error: Error building site: failed to render pages: render of "page" failed: execute of template failed: template: blog/single.html:5:7: executing "main" at <partial "nav.html" .>: error calling partial: execute of template failed: template: partials/nav.html:30:11: executing "partials/nav.html" at <partial "nav-i18n.html" .>: error calling partial: "/Users/tmdement/Code/helm-www/themes/helm/layouts/partials/nav-i18n.html:21:68": execute of template failed: template: partials/nav-i18n.html:21:68: executing "partials/nav-i18n.html" at <$translation.URL>: can't evaluate field URL in type page.Page
Built in 395 ms

@lucasreed pointed out on Slack that the HUGO_VERSION in netify.toml is set to 0.82.0 — I installed this release and was able to then run hugo serve:

> $ hugo serve
--------------
Start building sites … 
WARN 2022/03/08 15:49:45 Page.URL is deprecated and will be removed in a future release. Use .Permalink or .RelPermalink. If what you want is the front matter URL value, use .Params.url
WARN 2022/03/08 15:49:45 found no layout file for "HTML" for kind "section": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.

                   | EN  | DE | ES | FR | GR | JA | KO  | PT | RU | ZH   
-------------------+-----+----+----+----+----+----+-----+----+----+------
  Pages            | 185 | 22 | 21 | 10 |  9 | 36 | 135 | 32 | 10 | 134  
  Paginator pages  |   3 |  0 |  0 |  0 |  0 |  0 |   0 |  0 |  0 |   0  
  Non-page files   |  15 |  0 |  0 |  0 |  0 | 10 |   5 |  0 |  0 |   0  
  Static files     |  82 | 82 | 82 | 82 | 82 | 82 |  82 | 82 | 82 |  82  
  Processed images |   0 |  0 |  0 |  0 |  0 |  0 |   0 |  0 |  0 |   0  
  Aliases          |  67 |  0 |  0 |  0 |  0 |  0 |   1 |  0 |  0 |   0  
  Sitemaps         |   2 |  1 |  1 |  1 |  1 |  1 |   1 |  1 |  1 |   1  
  Cleaned          |   0 |  0 |  0 |  0 |  0 |  0 |   0 |  0 |  0 |   0  

Built in 850 ms
Watching for changes in /Users/tmdement/Code/helm-www/{content,i18n,package.json,postcss.config.js,themes}
Watching for config changes in /Users/tmdement/Code/helm-www/config.toml
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

Proposed Solution

A quick fix would be to update the README to specify the version of hugo that is required, and include steps for installing that specific release (unfortunatly brew install [email protected] doesn't work, but getting the binary from GitHub is straightforward).

A more complicated fix would be to make any required revisions to helm-www so that it is compatible with current hugo releases (this is my first experience using hugo, so I'm not sure how much work that would involve).

Notes

This is my first issue on any Helm board, so apologies if the formatting or requirements are off, would be happy to update if so.

Timothy-Dement avatar Mar 08 '22 21:03 Timothy-Dement

@flynnduism You might be best placed to answer this?

hickeyma avatar Mar 09 '22 08:03 hickeyma

Nice investigating @Timothy-Dement. I will work on adjusting the site so that it supports the recent versions of Hugo.

flynnduism avatar Mar 09 '22 17:03 flynnduism