1
0
silverbullet/website/Template Sets.md

57 lines
1.5 KiB
Markdown
Raw Normal View History

2023-11-19 11:18:16 +00:00
> **warning** Experimental
> This is still an experimental idea. These templates may change, be renamed etc. prepare yourself for breakage.
2023-11-15 13:56:34 +00:00
This is an attempt at collecting useful, reusable templates so you dont have to reinvent the wheel.
2023-11-19 11:18:16 +00:00
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.
2023-11-15 13:56:34 +00:00
2023-11-19 11:18:16 +00:00
To set this up, add the following this to your [[SETTINGS]]:
2023-11-15 13:56:34 +00:00
```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:
2023-12-22 15:40:38 +00:00
- uri: silverbullet.md/template/page/
2023-11-15 13:56:34 +00:00
```
2023-12-22 15:40:38 +00:00
to just get the page templates, for instance.
2023-11-15 13:56:34 +00:00
2023-12-22 15:40:38 +00:00
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.
2023-11-15 13:56:34 +00:00
```query
2023-12-22 15:40:38 +00:00
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]]
2023-11-15 13:56:34 +00:00
```
2023-12-22 15:40:38 +00:00
# Live Templates
Use these as `page` in [[Live Templates]].
2023-11-15 13:56:34 +00:00
```query
template
2023-12-22 15:40:38 +00:00
where type = "live"
2023-11-15 13:56:34 +00:00
order by order
render [[template/documented-template]]
```
2023-12-22 15:40:38 +00:00
# Live Query
Use these in your `render` clauses in [[Live Queries]].
2023-11-15 13:56:34 +00:00
```query
2023-12-22 15:40:38 +00:00
template
where type = "query"
2023-11-15 13:56:34 +00:00
order by order
render [[template/documented-template]]
```