hackmd-io-issues icon indicating copy to clipboard operation
hackmd-io-issues copied to clipboard

[Feature Request] Allow access to frontmatter variables within the body of a note

Open shitchell opened this issue 4 years ago • 0 comments

Is your feature request related to a problem? Please describe. Whenever including tags or other metadata in a note, one must include them in two places:

  1. the front matter
  2. again in the body of the note

This completely goes against the DRY principle. If you're putting the same data in two places, something needs to be optimized.

Describe the solution you'd like There should be some way to include variables from the frontmatter in the body of a note, e.g.:

---
title: a simple note
tags: hackmd, github
---

{% title %}
===

###### tags: {% tags %}

hello world

Further, it would be awesome if this feature supported custom variables. I like to include the created variable in my notes for personal reference and compatibility with other platforms. Even though such a tag provides no extra functionality on hackmd, it would be splendid to be able to include the date a note was written in the body of the note without repeating myself.

This would further allow you to create better templates and better embeds. e.g.:

header.md


###### tags: {% tags %}

{% created %}

{% title %}
===

footer.md

{% authors %}

meeting-notes-template.md

---
title: meeting notes
created: 2021-02-22
tags: meeting, notes
authors: jack, dianne
---

{%hackmd @team/header %}

{%hackmd @team/footer %}

shitchell avatar Feb 22 '21 05:02 shitchell