- Description:
This key defines the parameters of this snippet.
- Appears in:
- Type:
Object<params.*>- Values:
This key defines a parser configuration that parses a list of distinct positional arguments based on their position.
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.
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.
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.
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.
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).This key defines a parser configuration that parses a repeating set of exact literal values.
This key defines a higher-order parser configuration that wraps a snippet string and allows it to repeat.
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.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: