1
0
silverbullet/website/Template Sets.md
2023-12-22 16:40:38 +01:00

57 lines
1.5 KiB
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.

> **warning** Experimental
> This is still an experimental idea. These templates may change, be renamed etc. prepare yourself for breakage.
This is an attempt at collecting useful, reusable templates so you dont have to reinvent the wheel.
While you may just copy & paste these templates to your own space, the most convenient ways to use them is using [[Federation]]. This will synchronize these templates into your space and make them available for use instantly.
To set this up, add the following this to your [[SETTINGS]]:
```yaml
federate:
- uri: silverbullet.md/template
```
If you dont want to sync _all_ these templates, you can use more specific URIs, e.g.
```yaml
federate:
- uri: silverbullet.md/template/page/
```
to just get the page templates, for instance.
To reference a template, use the [[Federation]] syntax, e.g. `[[!silverbullet.md/template/task]]`.
# Page Templates
Use these [[Page Templates]] with the {[Page: From Template]} command.
```query
template where type = "page" render [[template/documented-template]]
```
# Slash Templates
These can be used as [[Slash Templates]]:
```query
template where type = "slash" render [[template/documented-template]]
```
# Live Templates
Use these as `page` in [[Live Templates]].
```query
template
where type = "live"
order by order
render [[template/documented-template]]
```
# Live Query
Use these in your `render` clauses in [[Live Queries]].
```query
template
where type = "query"
order by order
render [[template/documented-template]]
```