- Description:
This key represents an individual snippet parameter configuration in the
paramsobject.The value is an object that defines a parser configuration for a snippet parameter. Each parameter can use different parser types (argument, content, literal, etc.) with their specific options.
- Appears in:
- Types:
This key defines a parser configuration that parses a list of distinct positional arguments based on their position.
Appears in:
params.*.Show examplesHide examples
In this example, we have configured an argument list parser to parse distinct positional arguments based on their position.
MarkdownCopied to clipboard{{<figure "image.png" "My image title">}} └──────────────────────────┘This key defines a parser configuration that parses a single argument, optionally delimited by characters.
Useful for matching a single positional argument.
The argument parser is also used to parse a list of repeating arguments.
Appears in:
params.*.Show examplesHide examples
In this example, we have configured an argument parser to parse a single positional argument.
MarkdownCopied to clipboard{{<figure image.png>}} └───────┘In this example, we have configured an argument parser to parse a list of repeating arguments.
MarkdownCopied to clipboard{{<images image1.png image2.png image3.png>}} └──────────────────────────────┘This key defines a parser configuration that parses rich multiline content, such as the content between paired tags. Can be configured to parse nested snippets within.
Appears in:
params.*.Show examplesHide examples
In this example, we have configured a content parser to parse rich multiline content between paired tags.
LiquidCopied to clipboard{% highlight "js" %} let a = b; {% endhighlight %} └──────────┘This key defines a parser configuration that parses repeating pairs of keys and values.
Useful for most SSG snippets that take properties.
Can be configured to handle most syntax forms of key value pairs.
Appears in:
params.*.Show examplesHide examples
In this example, we have configured a key-value list parser to parse repeating pairs of keys and values in Liquid syntax.
LiquidCopied to clipboard{% include "image.html" image: "tree.png" alt: "Image of a tree" %} └──────────────────────────────────────┘In this example, we have configured a key-value list parser to parse repeating pairs of keys and values in Markdown syntax.
MarkdownCopied to clipboard<Link href="/about/" new_tab={true}/> └───────────────────────────┘This key defines a parser configuration that parses an exact literal value. Mainly useful when configuring a snippet template.
Appears in:
params.*.This key toggles whether matching zero times is a valid state for this parser.
Setting this key to
truewill allow matching zero times as a valid state. Iffalse, this parser requires at least one matching value. Setting this totrueis preferred to wrapping therepeatingparser inside anoptionalparser.By default, this key is
false(i.e., at least one matching value is required).Appears in:
params.*.This key defines a parser configuration that parses a repeating set of exact literal values.
Appears in:
params.*.This key defines a higher-order parser configuration that wraps a snippet string and allows it to repeat.
Appears in:
params.*.This key defines a wrapper parser configuration for wrapping another snippet configuration.
The value is an object that contains a
parserproperty set towrapperand anoptionsobject withsnippetand optionalremove_emptyproperties. The wrapper parser wraps another snippet configuration, allowing it to be used within a different snippet context.Appears in:
params.*.Show examplesHide examples
In this example, we have configured a wrapper parser to wrap a content snippet.
Copied to clipboard_snippets: example: snippet: <<example [[wrapped_content]]>> params: wrapped_content: parser: wrapper options: snippet: content content: snippet: <<content [[text]]>> params: text: parser: content options: editor_key: content_text{ "_snippets": { "example": { "snippet": "<<example [[wrapped_content]]>>", "params": { "wrapped_content": { "parser": "wrapper", "options": { "snippet": "content" } } } }, "content": { "snippet": "<<content [[text]]>>", "params": { "text": { "parser": "content", "options": { "editor_key": "content_text" } } } } } }- Examples:
In this example, we have configured a snippet parameter using an argument parser.
Copied to clipboard_snippets: example: snippet: <<example [[param]]>> params: param: parser: argument options: model: editor_key: example_id{ "_snippets": { "example": { "snippet": "<<example [[param]]>>", "params": { "param": { "parser": "argument", "options": { "model": { "editor_key": "example_id" } } } } } } }