mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-10 14:24:43 -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 */>}}
|
{{</* new-in 0.120.0 */>}}
|
||||||
{{< /code >}}
|
{{< /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
|
## Deprecated features
|
||||||
|
|
||||||
Use the "deprecated-in" shortcode to indicate that a feature is deprecated:
|
Use the "deprecated-in" shortcode to indicate that a feature is deprecated:
|
||||||
|
@ -10,8 +10,7 @@ action:
|
|||||||
- functions/transform/Remarshal
|
- functions/transform/Remarshal
|
||||||
- functions/transform/Unmarshal
|
- functions/transform/Unmarshal
|
||||||
signatures:
|
signatures:
|
||||||
- encoding.Jsonify INPUT
|
- encoding.Jsonify [OPTIONS] INPUT
|
||||||
- encoding.Jsonify OPTIONS INPUT
|
|
||||||
aliases: [/functions/jsonify]
|
aliases: [/functions/jsonify]
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -34,9 +33,5 @@ indent
|
|||||||
prefix
|
prefix
|
||||||
: (`string`) Indentation prefix. Default is "".
|
: (`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`.
|
: (`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 }}
|
{{ end }}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Intialize a variable, scoped to the current block:
|
||||||
|
|
||||||
|
```go-html-template
|
||||||
|
{{ with $var := 42 }}
|
||||||
|
{{ . }} → 42
|
||||||
|
{{ $var }} → 42
|
||||||
|
{{ end }}
|
||||||
|
{{ $var }} → undefined
|
||||||
|
```
|
||||||
|
|
||||||
## Understanding context
|
## 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.
|
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,13 +10,13 @@ button will be hidden if:
|
|||||||
@param {string} version The semantic version string, with or without a leading v.
|
@param {string} version The semantic version string, with or without a leading v.
|
||||||
@returns {template.HTML}
|
@returns {template.HTML}
|
||||||
|
|
||||||
@example {{< new-in 0.100.0 }}
|
@example {{< new-in 0.100.0 >}}
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
{{- /* Set defaults. */}}
|
{{- /* Set defaults. */}}
|
||||||
{{- $majorVersionDiffThreshold := 0 }}
|
{{- $majorVersionDiffThreshold := 0 }}
|
||||||
{{- $minorVersionDiffThreshold := 30 }}
|
{{- $minorVersionDiffThreshold := 30 }}
|
||||||
{{- $displayExpirationWarning := true}}
|
{{- $displayExpirationWarning := true }}
|
||||||
|
|
||||||
{{- /* Render. */}}
|
{{- /* Render. */}}
|
||||||
{{- with $version := .Get 0 | strings.TrimPrefix "v" }}
|
{{- with $version := .Get 0 | strings.TrimPrefix "v" }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user