Markdown files without metadata (for blogging)
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 🤷♂️
Author at Zettelkasten.de • https://christiantietze.de/
Howdy, Stranger!
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 useheader_includes:
in theexport.latex.yaml
andexport.pdf.yaml
files for $(\LaTeX)$ packages that I regularly use, so I needed a$more_header_includes$
section intemplate.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 (1st-order): Erel Dogg. Alter egos of Erel Dogg (2nd-order): Distracteur des Zettel, HueLED PacArt Lovecraft. I have no direct control over the 2nd-order alter egos. CC BY-SA 4.0.