- Description:
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:
└── Snippet └── params └── * └── Key Value List Parser Configuration- Type:
Object- Properties:
This key defines configuration options for key-value list parser configurations.
The value is an object that can contain
models,format, andstyleproperties. These options control how multiple key-value pairs are parsed and validated.Show examplesHide examples
In this example, we have configured key-value list parser options with models.
Copied to clipboard_snippets: example: snippet: <<example key1=value1 key2=value2>> params: params: parser: key_values options: models: key1: editor_key: value1_input key2: editor_key: value2_input{ "_snippets": { "example": { "snippet": "<<example key1=value1 key2=value2>>", "params": { "params": { "parser": "key_values", "options": { "models": { "key1": { "editor_key": "value1_input" }, "key2": { "editor_key": "value2_input" } } } } } } } }This key defines the parser type for key-value list parser configurations.
The value must be
key_values. This specifies that the parameter uses the key-value list parser, which parses multiple key-value pairs.Show examplesHide examples
In this example, we have configured a key-value list parser for a snippet parameter.
Copied to clipboard_snippets: example: snippet: <<example key1=value1 key2=value2>> params: params: parser: key_values options: models: key1: editor_key: value1_input key2: editor_key: value2_input{ "_snippets": { "example": { "snippet": "<<example key1=value1 key2=value2>>", "params": { "params": { "parser": "key_values", "options": { "models": { "key1": { "editor_key": "value1_input" }, "key2": { "editor_key": "value2_input" } } } } } } } }- 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}/> └───────────────────────────┘