1
0
silverbullet/website/Live Templates.md
Zef Hemel 0313565610
Complete redo of content indexing and querying (#517)
Complete redo of data store
Introduces live queries and live templates
2023-10-03 14:16:33 +02:00

35 lines
942 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Live templates rendering [[Templates]] inline in a page.
## Syntax
Live Templates are specified using [[Markdown]]s fenced code block notation using `template` as a language. The body of the code block specifies the template to use, as well as any arguments to pass to it.
Generally youd use it in one of two ways, either using a `page` template reference, or an inline `template`:
Heres an example using `page`:
```template
page: "[[template/today]]"
```
And heres an example using `template`:
```template
template: |
Today is {{today}}!
```
To pass in a value to the template, you can specify the optional `value` attribute:
```template
template: |
Hello, {{name}}! Today is _{{today}}_
value:
name: Pete
```
If you just want to render the raw markdown without handling it as a handlebars template, set `raw` to true:
```template
template: |
This is not going to be {{processed}} by Handlebars
raw: true
```