Metadata in a markdown file
If I have something in my YAML front matter, can I display that in my post? This does not seem to work when placed in the markdown file.
Date: September 15th, 2022
blah: Apple
{{metadata.blah}}
Figured it out {{entry.metadata.blah}}
Excellent, yes, {{metadata}} is a part of the {{entry}}. All these lines produce the same result:
- {{entry.metadata.blah}}
- {{#entry}} {{metadata.blah}} {{/entry}}
- {{#entry.metadata}} {{blah}} {{/entry.metadata}}
This is great. Is there any way to tie a CSS selector to this data in order to style it? I'm thinking about using the summary metadata after the title at the top of the post and want it to stand out. Thanks!
You could just wrap it in a span
<style>#styleMe {color:red;}</style>
<span id="styleMe">{{entry.metadata.blah}}</span>
or do it all in one line
<span style="color:blue;">{{entry.metadata.blah}}</span>
Thank you! I wrapped it in a div instead to get a nice bottom border, but used the same pattern.