mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 15:28:54 +00:00
30 lines
865 B
HTML
30 lines
865 B
HTML
{{/*
|
|
Renders an admonition or badge indicating the version in which a feature was introduced.
|
|
|
|
To render an admonition, include descriptive text between the opening and closing
|
|
tags. To render a badge, omit the descriptive text and call the shortcode with a
|
|
self-closing tag.
|
|
|
|
@param {string} 0 The semantic version string, with or without a leading v.
|
|
|
|
@example {{< new-in 0.144.0 />}}
|
|
|
|
@example {{< new-in 0.144.0 >}}
|
|
Some descriptive text here.
|
|
{{< /new-in >}}
|
|
*/}}
|
|
|
|
{{- with $version := .Get 0 | strings.TrimLeft "vV" }}
|
|
{{- partial "layouts/blocks/feature-state.html" (dict
|
|
"inner" (strings.TrimSpace $.Inner)
|
|
"name" $.Name
|
|
"page" $.Page
|
|
"position" $.Position
|
|
"status" "new"
|
|
"version" $version
|
|
)
|
|
}}
|
|
{{- else }}
|
|
{{- errorf "The %q shortcode requires a single positional parameter indicating version. See %s" .Name .Position }}
|
|
{{- end }}
|