Include / show note links in yaml frontmatter (v0.8.5)

On the top of a note, use the syntax:

---
tags: 
aliases:
whatever else you want to write:
---

to indicate frontmatter. Note that the main purpose of frontmatter is to give plugins a place to store user-readable metadata.

See the recent release notes on how to use tags and aliases. Note that these features are only available in Insider builds at this moment.

https://forum.obsidian.md/t/obsidian-release-v0-9-16-insider-build/8795

2 Likes

That’s cool.

Do you have examples of how tags and aliases are used?

I just added the functionality of updating a frontmatter in the “Markdown Prettifier” plugin. Perhaps I should take that feature out…

@WhiteNoise recommended in August to use this format

---
YAML metadata
---

your frontmatter

--- 
main text 

After all the changes in the meantime, is this still recommended, or I could put my custom attributes there like in ryan’s example above?

3 Likes

I have the same question. I also see (I think above, but I’ve got so many tabs open on this subject right now) that some will encapsulate their title not in quote marks " but double brackets [[ so that, I assume, they update with the note title changes. This works well, but it does not work in the YAML header either. Thoughts?

@ryanjamurphy, I’d love your input. (And thanks for all your contributions here and on talk.macpowerusers.com.)

1 Like

you can add your custom attributes in the YAML frontmatter but:

  • They MUST be in proper yaml format.
  • If an attribute is not handled by obsidian or plugin, it will be ignored. But still has to be YAML format.
  • There is no support (yet) for adding a linked mention to another note, that is, if NoteA has this frontmatter:
---
links: [[NoteB]], [[NoteC]]
---

It will not work. NoteA will not appear as a linked mention (backlink) in NoteB and NoteC.

  • The YAML frontmatter is not scanned when searching for unlinked mentions (and probably never will be). That is, if NoteA has this frontmatter:
---
connections: [NoteB, NoteC]
---

NoteA will not appear as an unlinked mention in NoteB and NoteC.

Addendum:
I would like to add that if at some point we add support for linking other notes in the YAML block, it will be specific and limited to a YAML attribute, like related: . But it still won’t be possible to add linked mentions in other attributes.
So if this is your intent, I think you are still better off with you own frontmatter in the document and not in the YAML block.

7 Likes

@millerstevew: thanks for the link to the mac power users site. As a 1 year old Mac novice I did not know it. Interesting stuff there.

2 Likes

First, I’d like to thank all contributors to Obsidian for making the absolute best knowledge management application!

Over the years all other applications never quite delivered and ideas of a better system started accumulating in my mind. The most notable idea being able to link anything to anything and use those links as tags themselves. Notion almost allowed this possibility, but not completely. Then Obsidian appeared, making this a reality!

As I’ve become aquatinted with Obsidian I’ve realized that many of my notes are of a particular type or kind. Let’s use Movie for example. For any note that’s a movie I can just add a [[Movie]] link to the top of my file and BAM, that link itself serves as a tag for all movies.

However, all notes that have an “is a” relationship to movie also happen to share a standard set a metadata such as director, run time, IMDB rating, etc. I also want this metadata to be links themselves. The obvious solution seems to be to create a template for Movie that I can apply to all “is a Movie” notes. This does begin to solve the problem of keeping all of the metadata standardized, but it does not solve every problem.

My next thought was for this metadata to be parsable in a way that I or someone else could build a plugin to view all notes that are a Movie in a table just like a Notion database with a standard set of properties. Then I found YAML support for Obsidian which seemed perfect! That is until I realized links do not yet work in YAML front matter. Therefore links could not also serve as the metadata entries.

I’m certainly not the only one that uses links as tags. It seems to be quite a popular trend. The other popular trend for users that use links as tags also seems to be adding links to the top of their notes that’s nearly identical to YAML front matter. This is a VERY common pattern.

TLDR

I deeply desire the option for YAML metadata to be universally link compatible. I want to build, or see built, plugins that can take advantage of YAML metadata that are also links, while at the same time Obsidian also observes them as links in the graph.

I propose that the syntax could be something like the following and just use the standard backlink formatting already used:

---
customProperty01: [notalink, randomstring]
customProperty02: [[[isalink]], [[another link]]]
customProperty03:
- notalink
- [[isalink]]
links: [NoteB, NoteC] <-- Similar to "tags", but creates links.
---
14 Likes

@pyrotecx Could you open a new #feature-requests for this? I’m afraid we won’t be able to track this in the feature archive and it will get lost.

1 Like