1
0
silverbullet/website/Frontmatter.md

23 lines
1.2 KiB
Markdown
Raw Normal View History

2022-12-07 16:05:27 +00:00
Frontmatter is a common format to attach additional metadata (data about data) to markdown documents.
2022-11-25 12:36:42 +00:00
2023-11-27 16:12:47 +00:00
In SilverBullet, there are multiple ways to attach [[Metadata]] to a page; frontmatter is one of them.
2023-07-25 15:33:24 +00:00
2022-11-25 12:36:42 +00:00
You create it by starting your markdown document with `---` followed by [[YAML]] encoded attributes and then ending with `---` again. Followed by the regular body of your document.
Here is an example:
---
status: Draft
tags:
- tag1
- tag2
---
## This is a section
This is content
SilverBullet allows arbitrary metadata to be added to pages this way, with two exceptions:
2022-11-25 12:36:42 +00:00
* `name` is an attribute used for page names, so dont attempt to override it in frontmatter
2023-11-27 16:12:47 +00:00
* `tags` can be specified (as in the example) and are, in effect, another way of adding tags to your page. You can achieve the same result by simply adding hashtags in the body of your document, e.g. `#tag1 #tag2`.
2022-11-25 12:36:42 +00:00
SilverBullet also has the _convention_ of using attributes starting with a `$` for internal use. For instance, the sharing capability uses the `$share` attribute, and `$disableDirectives: true` has the special meaning of disabling [[🔌 Directive]] processing on a page.