Files
hugo/docs/layouts/_shortcodes/new-in.html
T
2026-03-23 18:25:55 +01:00

31 lines
967 B
HTML

{{/* prettier-ignore-start */ -}}
{{- /*
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 >}}
*/ -}}
{{/* prettier-ignore-end */ -}}
{{- 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 }}