ikiwiki/doc/todo/support_mdwn_front_matter.mdwn

37 lines
1.5 KiB
Plaintext
Raw Normal View History

A number of static site generators and/or Markdown implementations
support the notion of a "front matter", a (normally) YAML list pre-
pended before the document text, containing document metadata. E.g.:
---
title: how to blog
author: Joe Bloggs
---
document goes here
IkiWiki has (currently) made a deliberate decision not to support these (or
more precisely, the similar but different Pandoc-style block with lines
prefixed by '%'). Quoting `mdwn.pm` (here in the section that handles
*Discount*):
# Disable Pandoc-style % Title, % Author, % Date
# Use the meta plugin instead
$always_flags |= Text::Markdown::Discount::MKD_NOHEADER();
It would be good to support YAML-formatted pre-pended metadata,
2021-10-15 23:06:44 +02:00
translating recognised keys into [[plugins/meta]] definitions, to aid
migration between IkiWiki and other static site generators: it
would aid the same source files being useable in multiple systems.
This would require the `mdwn` plugin to be more closely-coupled to
the `meta` plugin, but not the reverse. I think this wouldn't be a
big problem, as the prospect of an IkiWiki site that was using the
`mdwn` plugin but *not* the `meta` plugin is fairly remote. And we
could make front-matter handling configurably on or off.
References:
* [Pandoc extension yaml_metadata_block](https://pandoc.org/MANUAL.html#extension-yaml_metadata_block)
* [Hakyll 'pages and metadata'](https://jaspervdj.be/hakyll/tutorials/02-basics.html#pages-and-metadata)
* [Jekyll 'front matter'](https://jekyllrb.com/docs/front-matter/)
*— [[Jon]], 2021-10-15*