Some more about 0.112.0

This commit is contained in:
Bjørn Erik Pedersen 2023-05-23 09:05:25 +02:00
parent 39af43ef11
commit 91eb442754
No known key found for this signature in database
GPG Key ID: 330E6E2BD4859D8F
2 changed files with 10 additions and 5 deletions

View File

@ -73,10 +73,10 @@ Only the obvious non-global options can be overridden per language. Examples of
{{< new-in "0.112.0" >}}
In version `0.112.0` of Hugo we did a major we consolidated all configuration options, but also improved how the languages and their params gets merged with the main configuration. But while testing this on Hugo sites out there, we got some error reports.
In version `0.112.0` of Hugo we did a major we consolidated all configuration options, but also improved how the languages and their params gets merged with the main configuration. But while testing this on Hugo sites out there, we got some error reports, and reverted some of the changes in favour of deprecation warnings:
1. `site.Language.Params` is deprecated. Use `site.Params` directly.
1. The `params` sections on site and language is the only place to put custom user parameters, and `site.Params` will only contain these user defined parameters (see example below).
1. Adding custom params to the top level language config is deprecated, add all of these below `[params]`, see `color` in the example below.
```toml
title = "My blog"

View File

@ -1,8 +1,13 @@
{{ $version := .Get 0 }}
{{ if not $version }}
{{ errorf "Missing version in new-in shortcode "}}
{{ errorf "Missing version in new-in shortcode " }}
{{ end }}
{{ $version = $version | strings.TrimPrefix "v" }}
<button class="bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 mr2 ml2 px-4 border border-gray-400 rounded shadow">
<a href="{{ printf "https://github.com/gohugoio/hugo/releases/tag/v%s" $version }}" target="_blank">New in v{{$version}}</a>
<button
class="bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 mr2 ml2 px-4 border border-gray-400 rounded shadow">
<a
href="{{ printf "https://github.com/gohugoio/hugo/releases/tag/v%s" $version }}"
target="_blank"
>New in v{{ $version }}</a
>
</button>