Adding Metadata to your Pages
Dataview is a data index first and foremost, so it supports relatively rich ways of adding metadata to your knowledge base. Dataview tracks information at the markdown page and markdown list item (including task) levels, where each page/list item can have an arbitrary amount of fields associated with it. Each field is a named value with a certain type (like "number" or "text"). Read more about types here.
To make information available in dataview queries, you need to store this information in fields. All fields you add to a page (a note in your vault) can be later accessed when writing dataview queries.
You can add fields to a markdown page in three different ways.
Frontmatter is a common Markdown extension which allows for YAML metadata to be added to the top of a page. All YAML fields will be available as Dataview fields:
--- alias: "document" last-reviewed: 2021-08-17 thoughts: rating: 8 reviewable: false ---
For those wanting a more natural-looking annotation, Dataview supports "inline" fields, which
offer a simple
Key:: Value syntax that you can embed directly in your file:
# Markdown Page Basic Field:: Value **Bold Field**:: Nice!
I would rate this a [rating:: 9]! It was [mood:: acceptable].
This will not show the (very long key:: key).
Dataview annotates pages and tasks with a large amount of metadata automatically, like the day the file was
file.cday), any associated dates (
file.day), links in the file (
file.outlinks), tags (
and so on. Find the full list on Metadata on pages and Metadata on Tasks and Lists.