The concat
function joins multiple arguments together into a single string.
concat(arg1, arg2, ..., argN)
Parameter | Type | Description |
---|---|---|
arg1, ..., argN | scalar (string, number, boolean, null) | Required. One or more values to concatenate. Non-string values are converted to their string representation (e.g., true becomes "true" , 123 becomes "123" , null becomes "null" ). |
A single string resulting from the concatenation of all provided arguments.
Full name: {% concat($frontmatter.data.firstName, " ", $frontmatter.data.lastName) %}
Result:
Full name: John Doe
{% img src=concat("https://picsum.photos/id/", $frontmatter.data.imageId, "/300/200") /%}
Result:
{% card title=concat("Author", " ", $frontmatter.data.firstName, " ", $frontmatter.data.lastName) %}
I'm a **card**.
{% /card %}
Result:
Author John Doe
I'm a card.
- Markdoc functions overview - Learn about using built-in and custom functions for dynamic content manipulation and processing
- Build custom Markdoc functions - Define and integrate your own custom functions for advanced content processing and dynamic features