Currently, no name shortcodes (`{{< >}}`) enter unexpected branch and
throw `BUG: template info not set`. This patch checks if shortcode has
name or not earlier and throws specific error.
Closes#6866
.Site.Menus is mutated when it is sorted for now and this causes concurrency problem (#7594)
In this patch, each related sort function copies Menu before sorting to prevent
race condition.
Pages already have such a sort and cache logic and this patch is identical to it.
Closes#7594
Add Scratch.DeleteInMap method. This method works similar to Scratch.SetInMap. It takes in two string parameters, key and mapKey and deletes the value mapped to mapKey in key
Closes#8504
Add Scratch.DeleteInMap method. This method works similar to Scratch.SetInMap. It takes in two string parameters, key and mapKey and deletes the value mapped to mapKey in key
Closes#8504
Querify can now take a lone string/interface slice (with string
keys) as a parameter, or multiple string parameters, to build
URL queries.
Querify earlier used 'Dictionary' to add key/value pairs to a
map to build URL queries. Changed to dynamically generate ordered
key/value pairs. Cannot take string slice as key (earlier
possible due to Dictionary).
Added tests and benchmarks for querify.
Closes#6735
* Overhaul scratch.md
* Tweak scratch.md
* Small fixes
* Add link
* Use local Scratch in all examples
* Simplify intro and context vs local examples
I think this doc page was getting closer to blog post. All the history is not very relevant now that we're on 0.83.0. I took the liberty of simplifying. Let me know what you think...
* Remove redundancies and be more consistent
* Add history note
* Fix syntax error in example
Co-authored-by: Regis Philibert <login@regisphilibert.com>
This is an improvement over the `readfiles` shortcode in that it allows to insert content files that contain shortcodes themselves.
This new shortcode is used to fix a regression introduced in https://github.com/gohugoio/hugoDocs/pull/1442 (`new-in` shortcode was not rendered as intended).
Fix this by
1. Making sure that only numerical values are treated as plural counts
2. Making sure that `i18n.pluralFormNotFoundError` is not logged as a warning if `other` resolved.
Note that 2. isn't a new problem, but became visible because of the plural improvements in Hugo `0.83.0`.
Fixes#8492