hackmdio / hackmdio/hackmd-io-issues

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

Open
#238 0 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
No language data
Stars
40
Forks
9
PR merge metrics
No merged PRs in 30d

Description

**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.:

```md
---
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*
```md

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

{% created %}

{% title %}
===
```

*footer.md*
```md
{% authors %}
```

*meeting-notes-template.md*
```md
---
title: meeting notes
created: 2021-02-22
tags: meeting, notes
authors: jack, dianne
---

{%hackmd @team/header %}

{%hackmd @team/footer %}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.