Closed nsheff closed 3 years ago
In this case, I'd recommend using the underlying library directly. If you have YAML frontmatter, you can use PyYAML:
import yaml
yaml.dump(post.metadata)
That's most of what's happening under the hood: https://github.com/eyeseast/python-frontmatter/blob/master/frontmatter/default_handlers.py#L240-L249
I know I can do
frontmatter.dumps(post)
to get the original frontmatter+md source back as a string -- but I propose an additional hook to get just the original yaml frontmatter source back -- right now you if you split them, you can only get it as a dict.