I think support for YAML front matter might arrive someday. Here’s @manton in another thread:
Until then, here are some ideas for workarounds:
- You can add blog posts and pages via themes and plug-ins. So, you could have a my-blog-posts-plug-in containing all (or some) of your blog posts. That way, you get access to the YAML front matter. Here’s an example “blog post” from one of my plug-ins. Having to update a plug-in to write a blog post is tedious, though, and kind of misses the point of easy blogging via Micro.blog. (You could just host a Hugo or Elevently blog yourself in that case.)
- You can have your theme look for the first image in the blog post, as @yurymol already suggested.
- Or, you could have your theme look for some “magic” HTML and infer the featured image that way. For example:
Hey, this is my short blog post with additional <data id="featured-image" value="/uploads/2023/abd45e7e85.jpg">data</data>. - Instead of via HTML, you could provide the featured image via a Hugo shortcode. Something like:
{{< feature_image "/uploads/2023/abd45e7e85.jpg" >}}. And have your theme parse that.