Integrate frontmatter Values with Note Body

Use case or problem:

I am writing to propose an exciting addition to Obsidian MD that would greatly enhance its capabilities and provide users with the ability to seamlessly integrate dynamic content into their notes.

Proposed solution:

To achieve this functionality, I suggest implementing a feature that allows users to utilize file properties and insert their values directly into the body of their notes. This can be done by introducing a YAML front matter system that enables users to define file properties at the top of their notes. This section would serve as a repository of key-value pairs, allowing users to assign values to specific properties. Users can then effortlessly insert these property values into the body of their notes using a straightforward syntax, employing double curly braces ({{ }}).

Example:

---
myProperty: My Value
---

# My Note
This is the value of myProperty: {{myProperty}}

In this example, the {{myProperty}} placeholder will be dynamically replaced with “My Value” when previewing or rendering the note. Any modifications made to the value in the YAML front matter will automatically propagate throughout the note.

Current workaround :

Use the Templater plugin. For example, if you have a file property called “author” in your note, you can use {{tp.file.property("author")}} to insert the author’s name into your note.

However, this doesn’t completely function the same way as my proposal above because you cannot cite values from the frontmatter as you are writing the note.

There was also a plugin called: Obsidian Inline Variables, which had the intention of bringing this functionality to Obsidian but it appears to have been abandoned.

Related feature requests (optional):
None.

3 Likes

I’m looking for the same solution. But I also understand any reluctance to ‘pollute’ the markdown document with non-standard markup.

I’m sure we all came to markdown for the simplicity and lack of vendor lock-in. But then we miss the features of our old proprietary applications.

In the mean time, this might help: Obsidian Meta Bind. I found it to handle the use case quite well.

1 Like