hugo/docs/content/en/news/0.76.0-relnotes/index.md
2020-10-30 09:50:15 +01:00

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:

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

Other

Fixes

Templates

  • Fix grammar in the new 'requires non-zero' error message cd830bb0 @nekr0z

Other