Skip to content

Update Hugo to v0.145.0 and fix Resource.Err deprecation #50100

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ntheanh201
Copy link
Member

Description

This PR updates the website to use Hugo v0.145.0 (from v0.133.0) and fixes compatibility issues with the deprecated Resource.Err field.
See: https://gohugo.io/functions/go-template/try

Issue

When running with Hugo v0.141.0+, the build fails with the error:
"can't evaluate field Err in type resource.Resource: Resource.Err was removed in Hugo v0.141.0 and replaced with a new try keyword"

Closes: #49836

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 14, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign salaxander for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the sig/docs Categorizes an issue or PR as relevant to SIG Docs. label Mar 14, 2025
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 14, 2025
@ntheanh201 ntheanh201 force-pushed the update_hugo_version branch from 958ed25 to 2277060 Compare March 14, 2025 23:34
Copy link

netlify bot commented Mar 14, 2025

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 958ed25
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/67d4bc8e20975900083fa7c3
😎 Deploy Preview https://deploy-preview-50100--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Mar 14, 2025

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 2277060
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/67d4bcf1683b180008ab175a
😎 Deploy Preview https://deploy-preview-50100--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ntheanh201
Copy link
Member Author

Hi @natalisucks, @divya-mohan0209 can you check my PR?

@SayakMukhopadhyay
Copy link
Member

The latest release of Docsy (0.11.0) has official support upto 0.136.1 (see). Although the HEAD has been updated to a pretty recent version of Hugo, it should be noted that we are multiple versions of Docsy behind.

As such, I don't have a lot of confidence about whether a newer version of Hugo will remain compatible as we upgrade towards the latest Docsy.

@sftim
Copy link
Contributor

sftim commented Mar 22, 2025

/hold

given the valid-looking concern in #50100 (comment)

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 22, 2025
@sftim
Copy link
Contributor

sftim commented Mar 22, 2025

/area web-development

@k8s-ci-robot k8s-ci-robot added the area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes label Mar 22, 2025
@sftim sftim mentioned this pull request Mar 22, 2025
@ntheanh201
Copy link
Member Author

The latest release of Docsy (0.11.0) has official support upto 0.136.1 (see). Although the HEAD has been updated to a pretty recent version of Hugo, it should be noted that we are multiple versions of Docsy behind.

As such, I don't have a lot of confidence about whether a newer version of Hugo will remain compatible as we upgrade towards the latest Docsy.

Hi @SayakMukhopadhyay, do you have any idea?

@SayakMukhopadhyay
Copy link
Member

Hi @SayakMukhopadhyay, do you have any idea?

I'm sorry, idea of what exactly? Our suggestion would be to downgrade your Hugo version if you are using a local build or alternatively, use a container build, which comes with its own Hugo.

@ntheanh201
Copy link
Member Author

Hi @SayakMukhopadhyay, do you have any idea?

I'm sorry, idea of what exactly? Our suggestion would be to downgrade your Hugo version if you are using a local build or alternatively, use a container build, which comes with its own Hugo.

Docsy's 0.11.1 (unreleased) has support Hugo 0.145.0 (https://github.com/google/docsy/blob/3b8482557b530533e627292638a18b42da783540/package.json#L44C5-L44C33), I think we can wait until it's released and then update this K8s website docsy to 0.11.1?

@SayakMukhopadhyay
Copy link
Member

I think we can wait until it's released and then update this K8s website docsy to 0.11.1?

Updating the website to the latest Docsy is non trivial process since it has a lot of customisations. We are in the process of upgrading one minor version at a time. See #49430 for some background on our attempt to migrate to 0.7.0 which also has links to some other issues and PRs that might be helpful.

Anyway, if you would like to assist in this upgrade, help is welcome.

@ntheanh201
Copy link
Member Author

I think we can wait until it's released and then update this K8s website docsy to 0.11.1?

Updating the website to the latest Docsy is non trivial process since it has a lot of customisations. We are in the process of upgrading one minor version at a time. See #49430 for some background on our attempt to migrate to 0.7.0 which also has links to some other issues and PRs that might be helpful.

Anyway, if you would like to assist in this upgrade, help is welcome.

Thank you for the context on the Docsy upgrade challenges. I understand that the customizations make this a complex process requiring an incremental approach. I've reviewed #49430 and would happily assist with the upgrade efforts.

@SayakMukhopadhyay
Copy link
Member

I've reviewed #49430 and would happily assist with the upgrade efforts.

If you are in the kubernetes slack, give me a mention in the #sig-docs channel (same name as here) and we can discuss in detail there.

@ntheanh201
Copy link
Member Author

I've reviewed #49430 and would happily assist with the upgrade efforts.

If you are in the kubernetes slack, give me a mention in the #sig-docs channel (same name as here) and we can discuss in detail there.

I did

@iamNoah1
Copy link
Contributor

iamNoah1 commented Apr 4, 2025

@SayakMukhopadhyay @ntheanh201 do we have any update on this after you discussed detail on slack?!

@SayakMukhopadhyay
Copy link
Member

@SayakMukhopadhyay @ntheanh201 do we have any update on this after you discussed detail on slack?!

@iamNoah1 We will still need to work towards upgrading the Docsy version of the website first before we can get this PR merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bump Hugo version
5 participants