v0.99.0
The theme of this release is error handling – a topic grievously underrated in most development tools. You are often expected to Google this mysterious error and end up in some Stackoverflow thread telling you to use a specific Node version. Hugo has done an OK job in this department, but when I, @bep, recently got stuck with a minify error I had no clue how to debug, I knew we had to take another look at this. There is a list of "error improvements below", but here is one visual example:
The two screenshots above is from the same template error in Hugo v0.98.0
(left) and the new v0.99.0
(right). This is a type error (method not found) in a partial included in a shortcode template. We did a decent job in v0.98.0
, too, pointing at correct line in the partial. But the right version has the full stack, with absolute filename, line and column and some file context (highlighted lines) for all of the files involved in the error (Markdown file, shortcode and partial). Having these source file references to click on in the VS Code terminal is a real time saver, especially in Hugo projects with mulitiple file roots (themes, theme components).
A list of the most important "error improvements":
- A new server error template (can be overridden in
layouts/_server/error.html
), always add the content file context if relevant, improve JS errors, Add file context (with position) to codeblock render blocks, add file context to errors in the publishing step (e.g. minify), and more. #9892 #9891 #9893 - Fix SIGINT handling (allowing to kill the server) after loading bad configuration #9664
- Improve SASS/SCSS errors (both Dart SASS and Libsass) #9897
- Fix line numbers in errors from PostCSS, add missing file context to "import not found" #9895
Also worth mentioning is the new clock
cli flag (#8787 ) which allows you to "set the clock" and see how your site looks like ... in the future.
This release represents 24 contributions by 4 contributors to the main Hugo code base.@bep leads the Hugo development with a significant amount of contributions, but also a big shoutout to @dependabot[bot], @satotake, and @nathannaveen for their ongoing contributions.
Many have also been busy writing and fixing the documentation in hugoDocs,
which has received 3 contributions by 2 contributors.
Hugo now has:
- 58934+ stars
- 428+ contributors
- 399+ themes
Notes
- Hugo will now by default fail the build if an inline import cannot be resolved with
inlineImports=true
enabled forresources.PostCSS
. See https://gohugo.io/hugo-pipes/postcss/#options
Changes
- server: Refresh the error template 657d1a2 @bep
- server: Fix SIGINT handling after loading bad configuration 87a22eb @bep #9664
- Improve SASS errors fc9f315 @bep #9897
- postcss: Fix import error handling 4b189d8 @bep #9895
- build(deps): bump github.com/fsnotify/fsnotify from 1.5.3 to 1.5.4 c2fa0a3 @dependabot[bot]
- common/herrors: Remove unused struct 48ea24f @bep
- build(deps): bump github.com/evanw/esbuild from 0.14.38 to 0.14.39 9f56385 @dependabot[bot]
- errors: Misc improvements 5c96bda @bep #9892 #9891 #9893
- server: Always rebuild the files involved in an error 4a96df9 @bep #9884
- postcss: Fix line numbers in error messages e8537e6 @bep #9880
- Update CONTRIBUTING.md 2fbdee7 @bep
- js: Bump test dependency 91fe1b6 @bep
- deps: Update github.com/spf13/cast v1.4.1 => v1.5.0 7de6291 @bep
- hugolib: Check for nil in shouldRender 9d7f166 @bep
- Revise the use of htime.Since/htime.Now 51f08b0 @bep #9868
- tpl/collections: Make sort stable 860c51c @bep #9865
- docs: Regen CLI docs 855e586 @bep
- Use configured timeZone for the clock 35c88a7 @bep #8787
- Add
clock
cli flag e77ca3c @satotake #8787 - Improve error messages, esp. when the server is running f2946da @bep #9852 #9857 #9863
- tpl: Improve godoc 6eea32b @bep
- github: Add permissions to test action a6d5458 @nathannaveen
- tpl/crypto: Add example for FNV32a e5f2173 @bep
- releaser: Prepare repository for 0.99.0-DEV 89c1655 @bep