mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-09 01:14:41 -04:00
Miscellaneous edits and corrections
This commit is contained in:
parent
41b54d4210
commit
24236f57d9
@ -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 [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:
|
||||
|
@ -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/
|
||||
|
@ -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.
|
||||
|
@ -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. */}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user