Hugo v0.101.0 comes with GIF animation image processing, a new hl_inline option for code highlighting, a new :slugorfilename permalink keyword, we now respect the NO_COLOR OS env var, and more.
This release represents 35 contributions by 9 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], @jmooring, and @vanbroup for their ongoing contributions. Also a shoutout to @CIAvash for his work on the Chroma highlighter.
Many have also been busy writing and fixing the documentation in hugoDocs,
which has received 3 contributions by 2 contributors.
Hugo now has:
- 59557+ stars
- 428+ contributors
- 399+ themes
Changes
- build: Update to Go 1.18.3 2c5943d @bep #9964
- docs: Regen docshelper 0cb459a @bep
- markup/highlight: Add hl_inline option d863dde @bep #9442 #9635 #9638
- deps: Update github.com/alecthomas/chroma/v2 v2.1.0 => v2.2.0 580b214 @bep
- build(deps): bump github.com/clbanning/mxj/v2 from 2.5.5 to 2.5.6 ddb9547 @dependabot[bot]
- build(deps): bump github.com/pelletier/go-toml/v2 from 2.0.1 to 2.0.2 288b0fb @dependabot[bot]
- build(deps): bump golang.org/x/tools from 0.1.10 to 0.1.11 3e13446 @dependabot[bot]
- build(deps): bump github.com/tdewolff/minify/v2 from 2.11.5 to 2.11.10 7a9ce0e @dependabot[bot]
- build(deps): bump github.com/evanw/esbuild from 0.14.42 to 0.14.43 f2ba0cc @dependabot[bot]
- build(deps): bump github.com/getkin/kin-openapi from 0.94.0 to 0.97.0 62ceaab @dependabot[bot]
- deps: Udpate to github.com/alecthomas/chroma/v2 35fa192 @bep #9932 #9931
- common: Add hugo.GoVersion 09ac733 @khayyamsaleem #9849
- resources: Panic on Copy of Resource with .Err 66da1b7 @bep #10006
- resources/page: Add :slugorfilename attribute 5a9ecb8 @dawidpotocki #385
- Respect NO_COLOR cbc35c4 @bep #10004
- readme: Update dependency list 44f3c07 @deining
- Fix relURL with leading slash when baseURL includes a subdirectory a5a4422 @bep #9994
- js: Resolve index.esm.js 617e094 @bep #8631
- Add animated GIF support cf12fa6 @bep #5030
- resources: Add a Gif source file to golden tests 2e1c817 @bep
- releaser: Prepare repository for 0.101.0-DEV 4276075 @bep
- releaser: Bump versions for release of 0.100.2 d25cb29 @bep
- releaser: Add release notes for 0.100.2 [ci skip] 8b9bdc4 @bep
- Update CONTRIBUTING.md 4e94d1d @bep
- Fix raw TOML dates in where/eq 0566bbf @bep #9979
- deps: Update to github.com/pelletier/go-toml/v2 v2.0.1 534e715 @anthonyfok
- tpl/path: Add path.BaseName function 953f215 @jmooring #9973
- livereload: Use
X-Forwarded-Hostfor Codespace 8e2fd55 @satotake #9936 - helpers: Fix panic with invalid defaultMarkdownHandler 311b800 @bep #9968
- resources: Register MediaTypes before build c7d5f9f @vanbroup #9971
- releaser: Prepare repository for 0.101.0-DEV bfebd8c @bep
- releaser: Bump versions for release of 0.100.1 0afb486 @bep
- releaser: Add release notes for 0.100.1 [ci skip] b1ec0c2 @bep
- Fix panic with markdownify/RenderString with shortcode on Page with no content file 212d9e3 @bep #9959
- releaser: Prepare repository for 0.101.0-DEV 4daac65 @bep
This release is mostly motivated by the fix for the panic experienced by people having blackfriday configured as defaultMarkdownHandler (#9968). The Blackfriday support was removed in Hugo v0.100.0 after being deprecated with a warning for a long time.
- Fix raw TOML dates in where/eq 0566bbf @bep #9979
- deps: Update to github.com/pelletier/go-toml/v2 v2.0.1 534e715 @anthonyfok
- tpl/path: Add path.BaseName function 953f215 @jmooring #9973
- livereload: Use
X-Forwarded-Hostfor Codespace 8e2fd55 @satotake #9936 - helpers: Fix panic with invalid defaultMarkdownHandler 311b800 @bep #9968
- resources: Register MediaTypes before build c7d5f9f @vanbroup #9971
$page.RenderString (see #6703) finally supports shortcodes, and shortcode improvements is the main theme in Hugo 0.100.0.
Indentation fixes for shortcode blocks: We now record the indentation before the opening shortcode tag when parsing the source. This allow us to fix a couple of annoying issues in Hugo:
- We have added a new
.InnerIndentmethod to the shortcode context to prevent thehighlightshortcode from including in the indentation as part of the code block. See #4717. - Hugo now preserves the indentation for shortcode blocks. See more below.
A shortcode block is when the shortcode is included as the first non-whitespace content on a line. Note that this does not touch shortcodes with inner content, where the user is in control of the indentation. See issue #9946 for more information. An example, say that I have this in layouts/shortcodes/mylist.md:
* Culpa enim incididunt fugiat id dolore velit laboris veniam minim.
* Tempor ex nisi labore ad elit laborum ex ullamco aute labore eu occaecat.
* Deserunt mollit aliqua est laboris et irure eu non.
* Consectetur nulla minim non reprehenderit Lorem elit dolore quis.And then use that shortcode in a content file:
* My List
{{% mylist %}}In earlier versions of Hugo the above would render as:
Now it renders as:
Note that in the example above we use the md file suffix for the shortcode. In this release we also added Markdown as a built-in output format in Hugo, defined as a plain text format, meaning you get more lenient parsing compared to HTML. Using this if your shortcode produces Markdown has fewer quirks. See #9821.
Also noteworthy is the new template function resources.Copy which allows you to copy almost any Hugo Resource (the one exception is the Page), possibly most useful for renaming things:
This release represents 32 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 @moorereason for their ongoing contributions.
Many have also been busy writing and fixing the documentation in hugoDocs,
which has received 1 contributions by 1 contributors.
Hugo now has:
- 59255+ stars
- 428+ contributors
- 399+ themes
Notes
- The methods on Page
IsDescendantandIsAncestornow returns true for itself, which is obviously the correct behaviour. We have fixed this before, but reverted it because it broke some theme's logic. Looking back, that reversion was a mistake. If you want the old logic you can get that by doing somethiong ala{{ if or (eq $p1 $p2) ($p1.IsAncestor $p2) }}{{ end }}#9925 - We have removed Blackfriday as a Markdown option. It has been deprecated for a long time, its v1 version is not maintained anymore, and there are many known issues. Goldmark should be a mature replacement by now. #9944
Changes
- docs: Regen CLI docs 3fcbee2 @bep
- docs: Regen docs helper db9d274 @bep
- Fix indentation in highlight shortcode 6f7bf3f @bep #4717
- Make .RenderString render shortcodes 9e904d7 @bep #6703
- Improve shortcode indentation handling d2cfaed @bep #9946
- Add Markdown as an output format 322d19a @bep #9821
- build(deps): bump github.com/evanw/esbuild from 0.14.39 to 0.14.42 7cb484e @dependabot[bot]
- Run go mod tidy 0b395f0 @bep
- Add a shortcode benchmark c1a8307 @bep
- Remove Blackfriday markdown engine 0f8dc47 @bep #9934
- Fix HasMenuCurrent and IsDescendant/IsAncestor when comparing to itself 3b478f5 @bep #9846
- build(deps): bump github.com/sanity-io/litter from 1.5.4 to 1.5.5 f343b8e @dependabot[bot]
- deps: Update to github.com/tdewolff/minify/v2 v2.11.5 60ede14 @bep
- Don't use the baseURL /path as part of the resource cache key dd9eaf1 @bep #9787
- postcss: Make the resource cache key more stable 46a2ea6 @bep #9787
- commands: Fix case where languages cannot be configured 653ab2c @bep
- github: Set HUGO_BUILD_TAGS: extended when running tests 52edea0 @bep #9935
- metrics: Fix divide by zero error 6a5acd7 @moorereason
- Fix error message when PostCSS config file is not found 805b215 @bep #9927
- server: Skip watching dirs in ignoreFiles 8ca7052 @bep #9838
- resources: Improve error message on .Resize etc. on SVGs bb232a3 @bep #9875
- Fix Plainify edge cases 3854a6f @bep #9199 #9909 #9410
- Add resources.Copy cd0112a @bep #9313
- basefs: add
noBuildLockflag 6f7fbe0 @satotake #9780 - import: Fix importing jekyll site 2fc2e9c @satotake #9817
- releaser: Prepare repository for 0.100.0-DEV e164834 @bep
- releaser: Bump versions for release of 0.99.1 d524067 @bep
- releaser: Add release notes for 0.99.1 [ci skip] 31ce89f @bep
- releaser: Fix version replacement ee55fde @bep
- server: Fix multihost crash 2f9eac4 @bep #9901
- Update stale.yml 3a8189e @bep
- common/hugo: Fix version logic 7bc3401 @bep
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=trueenabled 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
clockcli 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
This release is mostly some important upgrades of Hugo's core dependencies, but we have also added crypto.FNV32a template function, which produces 32-bit unsigned integer hashes from a string. We have already many hash functions, but none of them produces an integer, which can be useful, e.g.:
This release represents 29 contributions by 3 contributors to the main Hugo code base.
Hugo now has:
- 58549+ stars
- 428+ contributors
- 399+ themes
Notes
Changes
- docs: Regen docs helper a4fff57 @bep
- Some godoc adjustments and image struct renames fa80fe3 @bep
- tpl/crypto: Add FNV32a 1104753 @bep
- markup/goldmark: Fix attribute nilpointer d7b54a4 @bep #9819
- deps: Update to gocloud.dev v0.24.0 13ceef7 @bep
- build(deps): bump github.com/mitchellh/mapstructure from 1.4.3 to 1.5.0 942d0dd @dependabot[bot]
- deps: Update github.com/yuin/goldmark v1.4.11 => v1.4.12 a022ca2 @jmooring #9054 #9756 #9757
- build(deps): bump github.com/evanw/esbuild from 0.14.36 to 0.14.38 d56b339 @dependabot[bot]
- deps: Update github.com/tdewolff/minify/v2 v2.11.1 => v2.11.2 55e28c2 @jmooring #9820
- Some godoc adjustments 9a888c2 @bep
- tpl/lang: Handle nil values in lang.Merge 05b45c3 @bep
- resources/page: Mark some more interface methods as internal 625be77 @bep
- Deprecate page.Author and page.Authors 097fd58 @bep
- releaser: Prepare repository for 0.98.0-DEV 41cc4e4 @bep
- releaser: Bump versions for release of 0.97.3 078053a @bep
- releaser: Add release notes for 0.97.3 [ci skip] 7d9f888 @bep
- Fix syncing of /static regression 9b352f0 @bep #9794 #9788
- Revert "Revert "Fix PostProcess regression for hugo server"" e66e2e9 @bep #9794
- releaser: Prepare repository for 0.98.0-DEV 5de6f8a @bep
- releaser: Bump versions for release of 0.97.2 5099abe @bep
- releaser: Add release notes for 0.97.2 [ci skip] 99ec88d @bep
- Revert "Fix PostProcess regression for hugo server" 6c35a1a @bep
- releaser: Prepare repository for 0.98.0-DEV 363bc90 @bep
- releaser: Bump versions for release of 0.97.1 04efcb2 @bep
- releaser: Add release notes for 0.97.1 [ci skip] 4560725 @bep
- Fix PostProcess regression for hugo server 4deb5c6 @bep #9788
- Fix MediaType when reading images from cache 397fce5 @bep #8931
- deps: Upgrade github.com/bep/overlayfs v0.4.0 => v0.5.0 0093eaa @bep #9783
- releaser: Prepare repository for 0.98.0-DEV d0f731c @bep
The v0.97.x release has been an Easter riddle. The new --renderStaticToDisk flag required a consolidation of the file systems in Hugo, which introduced a bug. The fix for that bug introduced a new bug, and reverting the obvious pick of the two candidate commits ... did not resolve the issue.
OK, all good things are three, and now with proper tests to avoid this particular issue happening again.
NOTE: We seem to have introduced an issue with /static synching of files in this release, so we recommend wait for thev0.97.3 and roll back to the v0.97.0 or earlier for now.
This release reverts one of the fixes from yesterday, which broke more than it fixed:
NOTE: We seem to have introduced an issue with /static synching of files in this release, so we recommend wait for thev0.97.3 and roll back to the v0.97.0 or earlier for now.
This is a bug-fix release with a couple of important fixes. Note that the MediaType on image conversion bug isn't a regression, that bug has been there since we added the target format option to the image processing methods.


