Describe the parameter definitions of the Hugo shortcode, which is useful for writing shortcode's documentation.
Become a backer or sponsor to support our work.
1{{% hugo/shortcode-params [data] %}}
data
Position | Name | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
#0 | data | string | ✓ | - | - | - |
The data filename.
heading
Position | Name | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
- | heading | string | - | Parameters | - | - |
The heading.
headingStartLevel
Position | Name | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
- | headingStartLevel | number | - | 2 | - | - |
The heading start level.
name
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
name | - | string | ✓ | - | - | - |
The parameter name.
position
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
position | - | number | - | - | - | - |
The index of positional parameter.
type
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
type | - | string /array | - | string | - | - |
The type of parameter.
required
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
required | - | boolean | - | false | - | - |
Indicates whether if the parameter is required.
default
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
default | - | string | - | - | - | - |
The default value of parameter.
since
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
since | - | string | - | - | - | - |
Indicates the version in which the parameter is added.
description
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
description | - | string/object | ✓ | - | - | - |
The description, support Markdown.
description.default
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
description.default | - | string | - | - | - | - |
The default description.
description.[lang]
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
description.[lang] | - | string | - | - | - | - |
Language-specific description.
options
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
options | - | array | - | - | - | - |
Available options.
deprecated
Name | Context | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
deprecated | - | string | - | false | - | - |
Indicates whether if the parameter is deprecated.
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="ln"> 1</span><span class="cl">- <span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l">foo</span><span class="w">
2 position: 0 3 required: true 4 description: 5 default: Foo description. 6 zh-hans: Foo 描述。 7 zh-hant: Foo 描述。 8 9- name: bar 10 type: number 11 since: v0.2.0 12 deprecated: true 13 description: 14 default: Bar description. 15 zh-hans: Bar 描述。 16 zh-hant: Bar 描述。 17 18- name: fizz 19 description: Single description without translations. 20 options: 21 - one 22 - two
Result as follows.
1{{% hugo/shortcode-params data="data/example-params.yaml" heading="Example Parameters" headingStartLevel=3 %}}
foo
Position | Name | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
#0 | foo | string | ✓ | - | - | - |
Foo description.
bar
Position | Name | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
- | bar | number | - | - | v0.2.0 | - |
Bar description.
fizz
Position | Name | Type | Required | Default | Since | Example |
---|---|---|---|---|---|---|
- | fizz | string | - | - | - | - |
Single description without translations.
Available options: one
, two
.