10 KiB
date: 2020-10-06 title: "Multiple Cascades With Page Filters" description: "Hugo 0.76.0 brings multiple cascade blocks per page with filters for path, kind and language." categories: ["Releases"]
In Hugo 0.76.0 you can now have a list of cascade blocks per page and a new _target
keyword where you can select which pages to cascade upon using Glob patterns for a Page
's Kind
, Lang
and/or Path
:
title ="Blog"
[[cascade]]
background = "yosemite.jpg"
[cascade._target]
path="/blog/**"
lang="en"
kind="page"
[[cascade]]
background = "goldenbridge.jpg"
[cascade._target]
kind="section"
Tasks that were earlier hard/borderline impossible to do are now simple. One common example would to apply a different template set to nested sections; you can now apply a custom Type
to these sections using path="/blog/*/**"
and similar.
A related improvement is that the build option render
is now an enum. In addition to turning on/off rendering of a given page you can tell Hugo to not render, but you want to preserve the .Permalink
, useful for SPA applications.
This release represents 35 contributions by 8 contributors to the main Hugo code base. A big shoutout to @bep, @ai, and @jmooring for their ongoing contributions. And a big thanks to @digitalcraftsman for his relentless work on keeping the themes site in pristine condition and to @davidsneighbour, @coliff and @kaushalmodi for all the great work on the documentation site.
Many have also been busy writing and fixing the documentation in hugoDocs, which has received 11 contributions by 6 contributors. A special thanks to @amdw, @davidsneighbour, @samrobbins85, and @yaythomas for their work on the documentation site.
Hugo now has:
- 47025+ stars
- 438+ contributors
- 354+ themes
Notes
We have added a force
flag to the server redirects configuration, configuring whether to override any existing content in the path or not. This is inline with how Netlify does it.
This is set to default false
. If you want the old behaviour you need to add this flag to your configuration:
[[redirects]]
from = "/myspa/**"
to = "/myspa/"
status = 200
force = true
Enhancements
Templates
- Add Do Not Track (dnt) option to Vimeo shortcode edc5c474 @joshgerdes #7700
Other
- Regen docshelper b9318e43 @bep
- Make BuildConfig.Render an enum 63493890 @bep #7783
- Allow cascade to be a slice with a _target discriminator c63db7f1 @bep #7782
- Add force flag to server redirects config 5e2a547c @bep #7778
- bump github.com/evanw/esbuild from 0.7.8 to 0.7.9 ee090c09 @dependabot[bot]
- bump github.com/tdewolff/minify/v2 from 2.9.5 to 2.9.7 05e358fd @dependabot[bot]
- bump github.com/aws/aws-sdk-go from 1.34.34 to 1.35.0 a2e85d9a @dependabot[bot]
- bump github.com/getkin/kin-openapi from 0.22.0 to 0.22.1 4fba78dd @dependabot[bot]
- bump github.com/aws/aws-sdk-go from 1.34.33 to 1.34.34 c011b466 @dependabot[bot]
- bump github.com/evanw/esbuild from 0.7.7 to 0.7.8 35348b4b @dependabot[bot]
- bump github.com/aws/aws-sdk-go from 1.34.27 to 1.34.33 34915777 @dependabot[bot]
- bump github.com/evanw/esbuild from 0.7.4 to 0.7.7 0f4a837e @dependabot[bot]
- bump github.com/tdewolff/minify/v2 from 2.9.4 to 2.9.5 b395d686 @dependabot[bot]
- Upgrade to go-i18n v2 97987e5c @bep #5242
- bump github.com/evanw/esbuild from 0.7.2 to 0.7.4 4855c186 @dependabot[bot]
- bump github.com/aws/aws-sdk-go from 1.34.26 to 1.34.27 6f07ec7e @dependabot[bot]
- bump github.com/alecthomas/chroma from 0.8.0 to 0.8.1 4318dc72 @dependabot[bot]
- bump github.com/evanw/esbuild from 0.7.1 to 0.7.2 acdc27a3 @dependabot[bot]
- Make sure CSS is rebuilt when postcss.config.js or tailwind.config.js changes 3acde9ae @bep #7715
- bump github.com/aws/aws-sdk-go from 1.34.22 to 1.34.26 0bce9770 @dependabot[bot]
- Update to github.com/tdewolff/minify v2.9.4 b254532b @bep
- Bump bundled Node.js from v12.18.3 to v12.18.4 05a22892 @anthonyfok
- Add preserveTOC option 8e553dcd @helfper
- bump github.com/frankban/quicktest from 1.10.2 to 1.11.0 d4fc70a3 @dependabot[bot]
- bump github.com/evanw/esbuild from 0.6.32 to 0.7.1 d905abc0 @dependabot[bot]
- bump github.com/rogpeppe/go-internal from 1.5.1 to 1.6.2 8f394674 @dependabot[bot]
- bump github.com/jdkato/prose from 1.1.1 to 1.2.0 b01b2564 @dependabot[bot]
- bump github.com/spf13/afero from 1.2.2 to 1.4.0 9fa5ebe2 @dependabot[bot]
- Preserve the original package.json if it exists 214afe4c @bep #7690