Debian Codegraph @

docs/layouts/_shortcodes/new-in.html

raw
1 {{/*
2 Renders an admonition or badge indicating the version in which a feature was introduced.
3
4 To render an admonition, include descriptive text between the opening and closing
5 tags. To render a badge, omit the descriptive text and call the shortcode with a
6 self-closing tag.
7
8 @param {string} 0 The semantic version string, with or without a leading v.
9
10 @example {{< new-in 0.144.0 />}}
11
12 @example {{< new-in 0.144.0 >}}
13 Some descriptive text here.
14 {{< /new-in >}}
15 */}}
16
17 {{- with $version := .Get 0 | strings.TrimLeft "vV" }}
18 {{- partial "layouts/blocks/feature-state.html" (dict
19 "inner" (strings.TrimSpace $.Inner)
20 "name" $.Name
21 "page" $.Page
22 "position" $.Position
23 "status" "new"
24 "version" $version
25 )
26 }}
27 {{- else }}
28 {{- errorf "The %q shortcode requires a single positional parameter indicating version. See %s" .Name .Position }}
29 {{- end }}