14 KiB
date: 2021-11-02 title: "Fine Grained File Filters" description: "Hugo 0.89.0 brings fine grained file filters, archetype rewrite, dependency refresh, and more ..." categories: ["Releases"]
This release is a dependency refresh (the new Goldmark version comes with a lot of bug fixes, as one example), many bug fixes, but also some nice new features:
We have added the configuration settings includeFiles and excludeFiles to the mount configuration. This allows fine grained control over what files to include, and it works for all of Hugo's file systems (including /static
).
We have also reimplemented archetypes. The old implementation had some issues, mostly related to the context (e.g. name, file paths) passed to the template. This new implementation is using the exact same code path for evaluating the pages as in a regular build. This also makes it more robust and easier to reason about in a multilingual setup. Now, if you are explicit about the target path, Hugo will now always pick the correct mount and language:
hugo new content/en/posts/my-first-post.md
This release represents 50 contributions by 13 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 @anthonyfok for their ongoing contributions. And thanks to @digitalcraftsman for his ongoing work on keeping the themes site in pristine condition.
Many have also been busy writing and fixing the documentation in hugoDocs, which has received 23 contributions by 9 contributors. A special thanks to @jmooring, @bep, @coliff, and @vipkr for their work on the documentation site.
Hugo now has:
- 54999+ stars
- 430+ contributors
- 413+ themes
Notes
- Hugo now writes an empty file named
.hugo_build.lock
to the root of the project when building (also when doinghugo new mypost.md
and other commands that requires a build). We recommend you just leave this file alone. Put it in.gitignore
or similar if you don't want the file in your source repository. - We have updated to ESBuild
v0.13.12
. The release notes for v0.13.0 mentions a potential breaking change. - We now only build AMD64 release binaries (see this issue) for the Unix OSes (e.g. NetBSD). If you need, say, a binary for ARM64, you need to build it yourself.
- We now build only one release binary/archive for MacOS (see this issue) that works on both Intel and the new Arm M1 systems.
.File.ContentBaseName
now returns the owning directory name for all bundles (branch an leaf). This is a bug fix, but worth mentioning. See this issue.- We have updated the Twitter shortcode to use Twitter's new API. See this issue for details.
Enhancements
Templates
- Use configured location when date passed to Format is string e82cbd74 @bep #9084
- Add path.Clean e55466ce @bradcypert #8885
Other
- Regen CLI docs f503b639 @bep
- Make ContentBaseName() return the directory for branch bundles 30aba7fb @bep #9112
- Update Twitter shortcode oEmbed endpoint 0cc39af6 @jmooring #8130
- bump github.com/evanw/esbuild from 0.13.10 to 0.13.12 7fa66425 @dependabot[bot]
- bump github.com/yuin/goldmark from 1.4.1 to 1.4.2 69210cfd @dependabot[bot]
- bump github.com/aws/aws-sdk-go from 1.40.8 to 1.41.14 3339c2bb @dependabot[bot]
- bump github.com/getkin/kin-openapi from 0.79.0 to 0.80.0 03bbdba8 @dependabot[bot]
- bump github.com/evanw/esbuild from 0.13.8 to 0.13.10 a772b8fc @dependabot[bot]
- Rename excepted filenames for image golden testdata dce49d13 @anthonyfok #6387
- bump github.com/frankban/quicktest from 1.13.1 to 1.14.0 61c5b7a2 @dependabot[bot]
- Validate the target path in hugo new 75c9b893 @bep #9072
- Set zone of datetime from from
go-toml
b959ecbc @satotake #8895 - Added nodesource apt repository to snap package 70e45481 @sergiogarciadev
- Set HUGO_ENABLEGITINFO=false override in Set_in_string 355ff83e @anthonyfok
- Add includeFiles and excludeFiles to mount configuration 471ed91c @bep #9042
- bump github.com/mitchellh/mapstructure from 1.4.1 to 1.4.2 94a5bac5 @dependabot[bot]
- Always preserve the original transform error 9830ca9e @bep
- Add hyperlink to the banner b64fd057 @itsAftabAlam
- bump github.com/getkin/kin-openapi from 0.78.0 to 0.79.0 2706437a @dependabot[bot]
- github.com/evanw/esbuild v0.13.5 => v0.13.8 ec7c993c @bep
- Return error on no content dirs 32c6f656 @bep #9056
- Add a cross process build lock and use it in the archetype content builder ba35e698 @bep #9048
- github.com/alecthomas/chroma v0.9.2 => v0.9.4 bb053770 @bep #8532
- Reimplement archetypes 9185e11e @bep #9032#7589#9043#9046#9047
- bump github.com/tdewolff/minify/v2 from 2.9.21 to 2.9.22 168a3aab @dependabot[bot]
- Update github.com/evanw/esbuild v0.13.5 8bcfa3bd @bep
- bump github.com/mattn/go-isatty from 0.0.13 to 0.0.14 cd4e67af @dependabot[bot]
- bump github.com/getkin/kin-openapi from 0.75.0 to 0.78.0 e6ad1f0e @dependabot[bot]
- Allow multiple plugins in the PostCSS options map 64abc83f @jmooring #9015
- Create path.Clean documentation f8d132d7 @jmooring
- Skip a test assertion on CI 26f1919a @bep
- Remove tracking image ecf025f0 @kambojshalabh35
- Revert "Remove credit from release notes" fab1e43d @digitalcraftsman
- Pass minification errors to the user e03f82ee @ptgott #8954
- Clarify "precision" in currency format functions a864ffe9 @ptgott
- bump github.com/evanw/esbuild from 0.12.24 to 0.12.29 b49da332 @dependabot[bot]
- Use default math/rand.Source for concurrency safety 7c21eca7 @odeke-em #8981
- Make the error handling for the mod commands more lenient 13ad8408 @bep
- Add some help text to the 'unknown revision' error 1cabf61d @bep #6825
- Update github.com/yuin/goldmark v1.4.0 => v1.4.1 268e3069 @jmooring #8855
Fixes
Templates
Other
- Fix description of lang.FormatNumberCustom 04a3b45d @jmooring
- Fix typo in error message 1d60bd1e @jmooring
- Fix panic when specifying multiple excludeFiles directives 64e1613f @bep #9076
- Fix file permissions in new archetype implementation e02e0727 @bep #9057
- Fix the "page picker" logic in --navigateToChanged 096f5e19 @bep #9051
- Fix a typo on OpenBSD c7957c90 @nabbisen
- Fix value of useResourceCacheWhen in TestResourceChainPostCSS e6e44b7c @jmooring