Miscellaneous edits and corrections

This commit is contained in:
Joe Mooring 2023-11-22 18:10:13 -08:00 committed by GitHub
parent 41b54d4210
commit 24236f57d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 35 additions and 28 deletions

View File

@ -288,6 +288,8 @@ Use the "new-in" shortcode to indicate a new feature:
{{</* new-in 0.120.0 */>}}
{{< /code >}}
The "new in" label will be hidden if the specified version is older than a predefined threshold, based on differences in major and minor versions. See&nbsp;[details](https://github.com/gohugoio/hugoDocs/blob/master/layouts/shortcodes/new-in.html).
## Deprecated features
Use the "deprecated-in" shortcode to indicate that a feature is deprecated:

View File

@ -10,8 +10,7 @@ action:
- functions/transform/Remarshal
- functions/transform/Unmarshal
signatures:
- encoding.Jsonify INPUT
- encoding.Jsonify OPTIONS INPUT
- encoding.Jsonify [OPTIONS] INPUT
aliases: [/functions/jsonify]
---
@ -34,9 +33,5 @@ indent
prefix
: (`string`) Indentation prefix. Default is "".
noHTMLEscape (false)
noHTMLEscape
: (`bool`) Disable escaping of problematic HTML characters inside JSON quoted strings. The default behavior is to escape `&`, `<`, and `>` to `\u0026`, `\u003c`, and `\u003e` to avoid certain safety problems that can arise when embedding JSON in HTML. Default is `false`.
See also the `.PlainWords`, `.Plain`, and `.RawContent` [page variables].
[page variables]: /variables/page/

View File

@ -36,6 +36,16 @@ Use with the [`else`] statement:
{{ end }}
```
Intialize a variable, scoped to the current block:
```go-html-template
{{ with $var := 42 }}
{{ . }} → 42
{{ $var }} → 42
{{ end }}
{{ $var }} → undefined
```
## Understanding context
At the top of a page template, the [context] (the dot) is a `Page` object. Inside of the `with` block, the context is bound to the value passed to the `with` statement.

View File

@ -10,7 +10,7 @@ button will be hidden if:
@param {string} version The semantic version string, with or without a leading v.
@returns {template.HTML}
@example {{< new-in 0.100.0 }}
@example {{< new-in 0.100.0 >}}
*/}}
{{- /* Set defaults. */}}