leven icon indicating copy to clipboard operation
leven copied to clipboard

support for optional hugo-style metadata block

Open andete opened this issue 7 years ago • 2 comments

E.g.:

+++ date = "2016-12-09T00:00:00+02:00" +++

Currently supports a date and a title field. If they are present they override the built-in approach of leven.

andete avatar Feb 16 '18 12:02 andete

Sorry for the late reply! Thanks a lot for this pull request, but I have a few questions:

  1. I know that this is the same syntax that Hugo uses, but do you think there could be a better delimiter for frontmatter than +++?
  2. Do you think this would be more useful if users could put arbitrary metadata in the post, that would be accessible to the rendering template, instead of just the title and the date? This might lead to more flexibility, and I can implement it if you're too busy. :)
  3. This is really irrelevant, but in metadata.rs, you have an unnecessary .collect() and a log! that I think was just for debugging.

quadrupleslap avatar Feb 21 '18 07:02 quadrupleslap

Heya,

  1. I'm open for other suggestions for a delimiter. Like you said I used what hugo uses. Feel free to select something else if you think it fits more to the style of your program.
  2. Yeah, I've been considering that as well. Could deserialize it to a generic serde Map. I'll give it a stab.
  3. I'll check it out and clean it up.

andete avatar Feb 21 '18 07:02 andete