silverbullet/website/Page Decorations.md

1.5 KiB
Raw Blame History

pageDecoration.prefix
🎄

Page decorations allow you to “decorate” pages in various ways.

For now “various ways” means just one way (adding a visual prefix), but in the future, more such decorations will likely be added.

There are two ways to decorate a page.

Frontmatter

The first is demonstrated in the Frontmatter of this page, by using the special pageDecoration attribute.

Settings

The more useful way is to apply decorations to pages dynamically, you can use the pageDecorations attribute in SETTINGS.

Every page decoration has two parts:

For example:

pageDecorations:
- where: "tags = 'person'"
  prefix: "🧑 "

This will prefix all pages tagged with #person with a 🧑 emoji.

Here on silverbullet.md, we have a decoration like this for pages tagged with #plug: Plugs/Emoji and Plugs/Git for instance.

Supported decorations

For now theres just one:

  • prefix: A (visual) string prefix (often an emoji) to add to all page names. This prefix will appear in the top bar as well as in (live preview) links to this page. For example, the name of this page is actually “Page Decorations”, but when you link to it, youll see its prefixed with a 🎄: Page Decorations

Again — later, more such decorations may be added.