balrog icon indicating copy to clipboard operation
balrog copied to clipboard

Plugable metadata parsers

Open brianloveswords opened this issue 11 years ago • 2 comments

So the original metadata parser works by convention: it expects the headers to represent title, author, date and tags in that specific order. This is super lightweight (implementation is only ~10 lines!) and awesome if your posts always conform to that.

However, for some of my stuff I wanted some finer control over what kinda metadata I can put into the doc. To that end, I wrote balrog-meta-htmlcomment to be able to declare metadata upfront in an HTML comment. This still allows the markdown files to be displayed directly (which would have been the issue with YAML frontmatter) but gives some better control.

We need to figure out a good way to declare which style of metadata parser to use. I'm thinking a couple of things:

  1. We could put something into config.json, like metadata: ('htmlcomment' | 'default')' or something like that.
  2. A new command on the balrog binary, balrog use meta-htmlcomment. This would also install the package if necessary.

I should also pull out/modularize the default parser.

brianloveswords avatar Oct 28 '13 03:10 brianloveswords

Cool! I like number one, but also defer to your judgement!

We should get rid of the old index.js and meta.js in the root, right?

jlord avatar Oct 30 '13 13:10 jlord

Yep! We can get rid of those. After thinking about it, I also believe number one is the best path.

brianloveswords avatar Oct 30 '13 13:10 brianloveswords