Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

latest hugo version breaks docs with error: "key kind not allowed in cascade config" #1302

Closed
mrjones-plip opened this issue Mar 6, 2024 · 3 comments

Comments

@mrjones-plip
Copy link
Contributor

mrjones-plip commented Mar 6, 2024

Right now we're on Hugo 0.101.0 per .tool_versions file, last updated in this PR. When we do go to 0.123 or later, we're going to get this error:

hugo serve

Start building sites … 
hugo v0.123.7-312735366b20d64bd61bff8627f593749f86c964+extended linux/amd64 BuildDate=2024-03-01T16:16:06Z VendorInfo=snap:0.123.7

Built in 168 ms
Error: error building site: process: readAndProcessContent: "/home/mrjones/Documents/MedicMobile/cht-docs/content/en/_index.md:1:1": key "kind" not allowed in cascade config

This is because on our _index.md file we declare a cascade with a kind declaration:

cascade:
- _target:
    path: "/**"
  kind: "page"
  type: "docs"
- _target:
    path: "/**"
  kind: "section"
  type: "docs"

There is a fix per this hugo issue, but it is not backwards compatible to earlier versions of Hugo. So, when the time comes, we can fix it, but ensure everyone fixes it first.


NB - when we fix this we should remove the version workaround on the trouble shooting page.

@mrjones-plip
Copy link
Contributor Author

mrjones-plip commented Mar 7, 2024

My stopgap fix was to:

  1. remove hugo which I'd installed with snap: sudo snap remove hugo
  2. then I needed to install both go and hugo. first, to install hugo, download the tarball: wget https://github.com/gohugoio/hugo/releases/download/v0.122.0/hugo_extended_0.122.0_linux-amd64.tar.gz
  3. now uncompressed it: tar xvzf hugo_extended_0.122.0_linux-amd64.tar.gz
  4. now move the binary into your $PATH: mv hugo ~/.local/bin
  5. Because snap resolved the dependency for go, I had to install go now too (I guess I could have sudo snap install go, but 🤷 ). First download it: wget https://go.dev/dl/go1.22.1.linux-amd64.tar.gz
  6. now uncompress it in the right path: tar -C /usr/local -xzf go1.22.1.linux-amd64.tar.gz
  7. finally, set your GOROOT. For me this was in ~/.zshrc by adding this last line: export PATH=$PATH:/usr/local/go/bin
  8. source your file so you get the new export: . ~/.zshrc

mrjones-plip added a commit that referenced this issue Mar 19, 2024
…wed" error (#1312)

* Update troubleshooting steps for new hugo "key kind not allowed" error

* add hugo version pinning to troubleshooting
@esthermmoturi
Copy link
Contributor

Hey @mrjones-plip , I believe this is now fixed after the upgrade on cht-docs main repo. Please confirm and close this ticket.

@mrjones-plip
Copy link
Contributor Author

confirmed it's fixed - thanks for the followup!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants