Zettelkasten Forum


Markdown files without metadata (for blogging)

edited September 2022 in Software & Gadgets

I've stumbled upon this post by Jim Nielsen:

https://blog.jim-nielsen.com/2022/markdown-sans-front-matter/

It describes how he went from Markdown files with metadata as YAML frontmatter:

---
title: My Blog Post
tags:
  - html
  - css
---

Start my blog post here.

... to just Markdown:

#html #css

# My Blog Post

Start my blog post here.

Jim's trick is to put the "slug" (i.e. the unique identifier that determines the URL of the published piece, which in the case of example.com/posts/my-amazing-post/ is the my-amazing-post part) into the filename. His filenames are of the format <YYYY-MM-DD>-<url-slug>.md, so starting with an ISO date, then the URL "path".

Making blogging simpler this way reminds me of how the way Sascha's and my Zettel format changed over the years, and how Sascha's very minimal solution eventually came about and sticks around since then:

# <ID> <TITLE>
<tags>

<content>

Very similar approach: make it pleasant for the human, let the app do the work. Avoid ceremony and technobabble.

I'd argue that Jim Nielsen's approach of putting hashtags before the title can worsen interoperability with applications that treat the first line of a file as the title -- but while that behavior is popular in a niche of plain text note-taking apps, it never really became a mainstream expectation, so 🤷‍♂️

Post edited by ctietze on

Author at Zettelkasten.de • https://christiantietze.de/

Comments

  • I follow Sascha's H1 level header format, # <ID> <TITLE>, which works with Zettlr. Zettlr can can be configured to interpret the first H1 level header as the title. I have a list of related links following this, and then hashtags.

    There is one exception to placing the H1 level header formatting at the beginning of the file. This is when I need $(\LaTeX)$ in the metadata, which I import using a modification of the pandoc template.tex file. I use header_includes: in the export.latex.yaml and export.pdf.yaml files for $(\LaTeX)$ packages that I regularly use, so I needed a $more_header_includes$ section in template.tex for includes in Markdown. The first H1 header after the initial YAML for $(\LaTeX)$ is still the first H1 header, so the title is unaffected. I have this documented, but I have received no indication that anyone else uses this or cares enough to comment, so I won't repeat it here.

    GitHub. Erdős #2. Problems worthy of attack / prove their worth by hitting back. -- Piet Hein. Alter ego: Erel Dogg (not the first). CC BY-SA 4.0.

Sign In or Register to comment.