Docs

Args

Use the args shortcode to generates a table of structured arguments.

Overview  

Use the args shortcode to generate a table of structured arguments. The argument definitions are expected to be defined in a data file identified by a provided structure name.

Name Type Required Default Comment
group string Name of the group filter. This is typically used when a shortcode and partial have common arguments. The group filter binds a specific argument to a particular group. By default, an argument belongs to all groups.
Name of the group filter. This is typically used when a shortcode and partial have common arguments. The group filter binds a specific argument to a particular group. By default, an argument belongs to all groups.
header-level int 3 v1.0.0      The header level to use for the user-defined type headers.
v1.0.0      The header level to use for the user-defined type headers.
page *hugolib.pageState, *hugolib.pageForRenderHooks, *hugolib.pageForShortcode yes Context of the current page.
Context of the current page.
parent bool Flag to filter only arguments that have a parent attribute (either cascade or merge).
Flag to filter only arguments that have a parent attribute (either cascade or merge).
render-type select both v1.0.0      Option whether to render arguments, user-defined types, or both. Please note that the arguments will render a link to a user-defined type in any case. Supported values: [arguments, types, both].
v1.0.0      Option whether to render arguments, user-defined types, or both. Please note that the arguments will render a link to a user-defined type in any case. Supported values: [arguments, types, both].
structure string yes Name of the data file that contains argument definitions. Supported data formats include JSON, TOML, YAML, and XML. You can omit the file extension. The file should reside in the data/structures folder. For bookshop components, add the bookshop- prefix to the structure name.
Name of the data file that contains argument definitions. Supported data formats include JSON, TOML, YAML, and XML. You can omit the file extension. The file should reside in the data/structures folder. For bookshop components, add the bookshop- prefix to the structure name.
markdown
{{< args "args" >}}

Data format  

Arguments support the following elements:

Name Type Required Default Comment
comment string Documentation about the argument.
Documentation about the argument.
default string Default value when no value is provided.
Default value when no value is provided.
deprecated string Points to the version in which the argument was deprecated (it may include the v prefix).
Points to the version in which the argument was deprecated (it may include the v prefix).
editors slice Per-editor type hints and options. Each item specifies a CMS editor name and an optional type override and editor-specific options for that editor. Currently supported editor names: cc (CloudCannon). Takes precedence over type-based inference.
Per-editor type hints and options. Each item specifies a CMS editor name and an optional type override and editor-specific options for that editor. Currently supported editor names: cc (CloudCannon). Takes precedence over type-based inference.
name string yes Argument name.
Argument name.
optional string Flag to indicate if the argument is optional.
Flag to indicate if the argument is optional.
options Options Conditional value requirements, depending on data type.
Conditional value requirements, depending on data type.
parent select Defines if the argument inherits a value from its parent. The value cascade indicates the child element should inherit the entire parent’s value. When set to merge, the parent and child values are merged together separated by a space character. Supported values: [cascade, merge].
Defines if the argument inherits a value from its parent. The value cascade indicates the child element should inherit the entire parent’s value. When set to merge, the parent and child values are merged together separated by a space character. Supported values: [cascade, merge].
release string Points to the version in which the argument was released (it may include the v prefix).
Points to the version in which the argument was released (it may include the v prefix).
type string yes Data type of the argument, either a primitive or complex type. Supported primitive types are bool, int, int64, float, float64, string, dict, and slice. Complex types can either be a dict or a slice and should be defined in data/_types.yml.
Data type of the argument, either a primitive or complex type. Supported primitive types are bool, int, int64, float, float64, string, dict, and slice. Complex types can either be a dict or a slice and should be defined in data/_types.yml.

Options Type  

Name Type Required Default Comment
max int End of the value range (inclusive).
End of the value range (inclusive).
min int Start of the value range (inclusive).
Start of the value range (inclusive).
values slice A slice of permitted select values.
A slice of permitted select values.

Arguments  

The shortcode supports both unnamed and named arguments.

Name Type Required Default Comment
group string Name of the group filter. This is typically used when a shortcode and partial have common arguments. The group filter binds a specific argument to a particular group. By default, an argument belongs to all groups.
Name of the group filter. This is typically used when a shortcode and partial have common arguments. The group filter binds a specific argument to a particular group. By default, an argument belongs to all groups.
header-level int 3 v1.0.0      The header level to use for the user-defined type headers.
v1.0.0      The header level to use for the user-defined type headers.
page *hugolib.pageState, *hugolib.pageForRenderHooks, *hugolib.pageForShortcode yes Context of the current page.
Context of the current page.
parent bool Flag to filter only arguments that have a parent attribute (either cascade or merge).
Flag to filter only arguments that have a parent attribute (either cascade or merge).
render-type select both v1.0.0      Option whether to render arguments, user-defined types, or both. Please note that the arguments will render a link to a user-defined type in any case. Supported values: [arguments, types, both].
v1.0.0      Option whether to render arguments, user-defined types, or both. Please note that the arguments will render a link to a user-defined type in any case. Supported values: [arguments, types, both].
structure string yes Name of the data file that contains argument definitions. Supported data formats include JSON, TOML, YAML, and XML. You can omit the file extension. The file should reside in the data/structures folder. For bookshop components, add the bookshop- prefix to the structure name.
Name of the data file that contains argument definitions. Supported data formats include JSON, TOML, YAML, and XML. You can omit the file extension. The file should reside in the data/structures folder. For bookshop components, add the bookshop- prefix to the structure name.
Follow Me

I work on everything coding and tweet developer memes