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

layouts: use new try function #115

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

Conversation

l-zeuch
Copy link
Contributor

@l-zeuch l-zeuch commented Jan 17, 2025

Summary

Hugo 0.141.0 introduced a new try function, replacing the way error
handling is done. Update the affected render hooks and shortcodes such
that they no longer break on Hugo 0.141.0 and above.

Basic example

See gohugoio/hugo#13216 for migration instructions and further details.

Motivation

  1. New users of this theme are likely to use the latest version of
    Hugo--ensure the build does not break for those.

  2. Our CI (and probably most of other automated Hugo builds) is set to
    always use the latest extended version of Hugo. Without this change,
    we'd have to pin it to 0.140.2 or below.

Checks

  • Read Creating a pull request
  • Supports all screen sizes (if relevant)
  • Supports both light and dark mode (if relevant)
  • Passes npm run test (if relevant)

Some further remarks, which I wish to fully resolve before landing this
change. We can downgrade Hugo in our CI for the meantime.

Should we bump the minimum Hugo version in the affected files? I'm
seeing a minimum of 0.114.0 at the moment, checked individually.
Alternatively, should we just introduce a safeguard around the affected
block of code, checking if we are required to use try and do so
conditionally, based on the Hugo version in use?

Personally I'm leaning towards not touching that minimum version, and
instead wrap the affected blocks in a new safeguard. That way, we can
comfortably cut a patch-level release and not worry about a
(technically) breaking change. Please let me know what you think.

Hugo 0.141.0 introduced a new `try` function, replacing the way error
handling is done. Update the affected render hooks and shortcodes such
that they no longer break on Hugo 0.141.0 and above.

Signed-off-by: Luca Zeuch <[email protected]>
Copy link

changeset-bot bot commented Jan 17, 2025

⚠️ No Changeset found

Latest commit: 032d88e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

l-zeuch added a commit to botlabs-gg/yagpdb-docs-v2 that referenced this pull request Jan 17, 2025
Hugo 0.141.0 introduced a new `try` function, replacing the way error
handling is done. Downgrade until we can land a fix in upstream, see
thuliteio/doks-core#115.

Signed-off-by: Luca Zeuch <[email protected]>
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

Successfully merging this pull request may close these issues.

1 participant