Describe the parameter definitions of the Hugo shortcode, which is useful for writing shortcode's documentation.
1{{% hugo/shortcode-params [data] %}}
data
Position | Name | Type | Required | Default | Since |
---|---|---|---|---|---|
#0 | data | string | ✓ | - | - |
The data filename.
heading
Position | Name | Type | Required | Default | Since |
---|---|---|---|---|---|
- | heading | string | - | Parameters | - |
The heading.
headingStartLevel
Position | Name | Type | Required | Default | Since |
---|---|---|---|---|---|
- | headingStartLevel | number | - | 2 | - |
The heading start level.
name
Name | Type | Required | Default | Since |
---|---|---|---|---|
name | string | ✓ | - | - |
The parameter name.
position
Name | Type | Required | Default | Since |
---|---|---|---|---|
position | number | - | - | - |
The index of positional parameter.
type
Name | Type | Required | Default | Since |
---|---|---|---|---|
type | string | - | string | - |
The type of parameter.
required
Name | Type | Required | Default | Since |
---|---|---|---|---|
required | boolean | - | false | - |
Indicates whether if the parameter is required.
default
Name | Type | Required | Default | Since |
---|---|---|---|---|
default | string | - | - | - |
The default value of parameter.
since
Name | Type | Required | Default | Since |
---|---|---|---|---|
since | string | - | - | - |
Indicates the version in which the parameter is added.
description
Name | Type | Required | Default | Since |
---|---|---|---|---|
description | string/object | ✓ | - | - |
The description, support Markdown.
description.default
Name | Type | Required | Default | Since |
---|---|---|---|---|
description.default | string | - | - | - |
The default description.
description.[lang]
Name | Type | Required | Default | Since |
---|---|---|---|---|
description.[lang] | string | - | - | - |
Language-specific description.
options
Name | Type | Required | Default | Since |
---|---|---|---|---|
options | array | - | - | - |
Available options.
deprecated
Name | Type | Required | Default | Since |
---|---|---|---|---|
deprecated | string | - | false | - |
Indicates whether if the parameter is deprecated.
1- name: foo
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 |
---|---|---|---|---|---|
#0 | foo | string | ✓ | - | - |
Foo description.
bar
Position | Name | Type | Required | Default | Since |
---|---|---|---|---|---|
- | bar | number | - | - | v0.2.0 |
Bar description.
fizz
Position | Name | Type | Required | Default | Since |
---|---|---|---|---|---|
- | fizz | string | - | - | - |
Single description without translations.
Available options: one
, two
.