Hugo instructions need updating

The instructions upon Hugo | Netlify CMS | Open-Source Content Management System 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 Content Manager 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? GitHub - kaihendry/netlify-cms-testing: Testing Netlify CMS

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

The are some good examples here Host on Netlify | Hugo

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 Hugo | Netlify CMS | Open-Source Content Management System … doesn’t seem to work though for me: netlify-cms-testing/config.yaml at master · kaihendry/netlify-cms-testing · GitHub

Bonus points: Can I show Netlify build info in Github? Commits · kaihendry/netlify-cms-testing · GitHub 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 Status badges | Netlify Docs

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): Scopes for OAuth Apps - GitHub Docs.
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: Docs(hugo): update docs to so preview sites will use relative links · Issue #3676 · netlify/netlify-cms · GitHub