Custom Front Matter

I think being able to specify front-matter for Hugo would solve many of the challenges I’ve been running in to setting this up. I got to thinking about how to do that.

I’d like to suggest and request that the Micropub endpoint add any unknown/unexpected properties as front-matter.

For example, curl -L 'https://micro.blog/micropub' -H "Authorization: $MICROPUB" -d 'h=entry' -d 'snarf=mongler' -d 'content=Scruffy looking nerf herder!' should add to the front matter for Hugo snarf: mongler as a custom property.

The Micropub specification already expressly contemplates using and accepting unknown vocabulary, so I think this would be well within the spirit of the spec.

Thanks!

That’s an interesting idea… One of the reasons we haven’t added custom front matter yet is I’m not sure where to put it in the UI, so supporting it via Micropub would solve that, keeping the main interface simple for now.

2 Likes

Support for custom front matter from Micropub would very elegantly solve a feature I’m planning for my blog.

My current prototype uses <data> elements in the note content. It works fine but it requires me to use regex to parse the data from the posts. By putting the data into the front matter it would be queryable by Hugo which would simplify my code considerably. :blush:

1 Like

I would be super appreciative of frontmatter-by-custom-header-Micropub before you figure out the UX.

Alsö, keeping my original post without preprocessing