Frontmatter
Summary
The ---
section at the top of each note is frontmatter.
Frontmatter is a collection of custom attributes at the top of each Markdown file. The beginning and end of this is indicated by ---
.
In Dendron, this is autogenerated when the note is created and it is used to store metadata about each note.
Example
---
id: 4RFQMNA91cRW12VJl_PFd
title: Taking Notes
desc: Creating notes, understanding hierarchy, and using Lookup to quickly find your notes
updated: 1639425310320
created: 1625563944736
nav_order: 1
---
Details
Frontmatter is YAML that you can add to the front of your Markdown file. It was first introduced by Jekyll and is a convenient way of adding metadata to your plaintext documents.
Dendron supports frontmatter. By default, we add the following keys to a new note created with Dendron:
id
: a globally unique identifier for the notetitle
: your note title. Used to label nodes in graph viewdesc
: optional description about your note. Will show up in lookup results as well as themetadata
when publishingupdated
: unix timestamp of when note was updatedcreated
: unix timestamp of when note was created
Frontmatter is required in Dendron, and it will warn you in the editor if you have any notes that don't have a frontmatter, or have a frontmatter that's broken. You can fix these by clicking on the lightbulb symbol that appears next to them, or using the fixFrontmatter Doctor action.
Feel free to add your attributes. As long as it doesn't conflict with a Dendron builtin keyword, Dendron will leave it alone. In the future, we plan on adding a lot more functionality to the frontmatter you see in Dendron so stay tuned.
Reserved Keys
Note that not all the keys are written out to the Markdown file. Dendron merges the attributes from the Markdown frontmatter to its own internal set of attributes.
id
A globally unique identifier for the note. This identifier is used for two things: (1) generating unique URLs when notes are published and (2) ensuring each note in the index is unique.
By default, a Dendron ID is lowercase, alphanumeric, and 23 characters long. Otherwise, IDs can be any string.
title
Your note title. Used to label nodes in graph view
desc
Optional description about your note. Will show up in lookup results.
updated
Unix timestamp of when note was updated
created
Unix timestamp of when note was created
parent
Node parent
children
Node children
uri
Absolute filepath to the note
tags
These are used for frontmatter tags.
data
This is reserved for internal use
custom
This is reserved for internal use
Other keys
Note Configuration
You can specify how notes are published via the frontmatter of each note.
canonicalUrl
- default: undefined
If set, adds CANONICAL_URL when publishing
<link rel="canonical" href="CANONICAL_URL" />
published
- default: true
To exclude a page from publication, you can add the following to the frontmatter. If you set publishByDefault: false
for a hierarchy, this needs to be set to true
to publish
...
published: false
nav_exclude
If set, do not include the current note in the navigation bar.
nav_order
- type: number
If set, denote order that item appears in the published nav bar
NOTE:
root
hasnav_order: 1
so thenav_order
of your denoted items must be superior to 1
By default, all notes at a given level are organized alphabetically
- Dendron
- Alpha
- Bravo
- Charlie
Same example where Bravo
has nav_order: 2
and Charlie
has nav_order: 1
- Dendron
- Charlie <-- appears first because it has the smallest nav order
- Bravo
- Alpha <-- appears last because notes with `nav_order` are sorted ahead of notes without `nav_order`
noindex
- default: false
To tell Google to not index a page, you can add the following tag to the frontmatter. You can also have this as a default for a given hierarchy by setting noIndexByDefault: true
in the site config.
...
noindex: true
gitNoLink
Disable git linking for this page
gitNotePath
When set, override how we generate the URL for the edit on GitHub link.
There are a few special variables you can set:
${noteHierarchy}
: this specifies the full hiearchy to the note in posix format- eg.
foo.bar
will translate tofoo/bar
- eg.
collection options
has_collection
- default: false
Whether a given page is a collection. A collection doesn't have a table of contents and allows you to set collection specific options.
NOTE: Setting this property
has_collection
in the frontmatter of parent note is sufficient.
date
If set, used to designate a custom publication date. By default, use timestamp of created
field.
skipLevels
If set, determines how many levels of children to skip when making the collection. For example, you might have the following hierarchy.
- blog.md
- blog.reading.md
- blog.reading.journal.md
- blog.reading.journal.2020.md
- blog.reading.journal.2020.12.md
- blog.reading.journal.2020.12.20.one.md
- blog.reading.journal.2020.12.31.two.md
When you publish, you might only want to show the leaf nodes and skip the intermediary levels. In the above example, setting skipLevels: 3
on blog.reading.md
will result in the following hierarchy being published.
- blog.md
- blog.reading.md
- blog.reading.journal.2020.12.20.one.md
- blog.reading.journal.2020.12.31.two.md
- NOTE: when you set
skipLevels
, this also affects children links
sort_order
- default:
ascending
- values:
ascending|reverse
Sort items in a collection page. Ascending by default. Specify reverse
to sort in descending order.
seo options
image
Sets image url for the page. Shows up in twitter card preview
excerpt
Sets a custom og:description
tag for the particular page
Children
Backlinks