Hugo instructions need updating

The instructions upon https://www.netlifycms.org/docs/hugo/ needs to be updated for a Hugo change:

{{ range (where .Pages "Section" "blog") }}

is now {{ range (where .Site.RegularPages “Section” “blog”) }}

I tried the Edit page link https://www.netlifycms.org/admin/#/edit/docs_guides/hugo but it Login with Github did nothing in Firefox 75.

How do I know what version of Hugo netlify builds with?

Hi @kaihendry, thanks for letting us know.
You can find the installed here:


and it is overridable via a HUGO_VERSION config.

I was able to access the page via Firefox 75 (MacOS), are you getting any console log errors?

1 Like

No console errors…

I think it’s because it launches a new window and the window went straight behind and I didn’t see it.

Could you propose a minimal netlify.toml for me to override HUGO_VERSION but still build it as if there wasn’t one? https://github.com/kaihendry/netlify-cms-testing

I would try in incognito and/or disable any browser extensions for debugging purposes.

The are some good examples here https://gohugo.io/hosting-and-deployment/hosting-on-netlify/

So I need to setup HUGO_VERSION for each environment? Just trying to avoid the copious LOC in that example.

[build.environment]
HUGO_VERSION = "0.69.1"

Should work for all environments

Thank you @erez!

Now just wondering if I can get my preview working: https://s.natalian.org/2020-04-23/publish_mode.mp4

Ah… it’s not linking to the Preview site … shouldn’t baseURL be overridden ?

I think I needed relativeURLs: true. Be good if this info & publish_mode: editorial_workflow was in https://www.netlifycms.org/docs/hugo/ … doesn’t seem to work though for me: https://github.com/kaihendry/netlify-cms-testing/blob/master/config.yaml

Bonus points: Can I show Netlify build info in Github? https://github.com/kaihendry/netlify-cms-testing/commits/master Or maybe a badge?

Looks like you committed that change into the master branch (not the PR branch) so you’ll need to test it with a new post or edit an existing post (this will cause the CMS to rebase with the mater branch).
You can read more about statues badges here https://docs.netlify.com/monitor-sites/status-badges/

I created a new post. Same issue.

Tbh when I run hugo serve locally, the URLs are not relative. Must be something hugo side then…

Also I don’t think I want to edit your instructions if I have to give up control of my repos?!?

Your HTML fragment with <a href="{{ .Permalink }}"> should be RelPermalink for the Preview site to work.

Hi @kaihendry,
The permissions are the least possible ones we can ask as the GitHub API doesn’t let you scope down by repo (only all public/private repos access): https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/#available-scopes.
You could also edit that page directly in GitHub and submit a PR that way.
So both relativeURLs: true and RelPermalink are required? We would need to think of a good way to communicate that in the docs.
Thank you again

Only RelPermalink actually, thanks!

1 Like

Thanks @kaihendry, I’ve opened an issue to update the docs: https://github.com/netlify/netlify-cms/issues/3676