piranha/gostatic

Please consider using YAML standard syntax

Opened this issue · 10 comments

Hi,

I noticed gostatic uses ---- for marking the end of YAML header. Following the [official specification[(http://www.yaml.org/spec/1.2/spec.html) --- marks the beginning and ... marks the end. Please consider to change gostatic accordingly. Something like:


---
date: 2015-10-01
title: GFoo
...
Hi. This is a post.

Others do it. This allows the processing of the document of the majority of scripts threating YAML headers.

It's not YAML, it's just something I parse myself by hand. I took four dashes from Markdown, where four dashes means a horizontal line.

Perhaps the delimiter is not YAML but the content it is. Please reconsider it although it's an incompatible change

juev commented

+1

Content is not YAML. It could be subset of YAML, or maybe there are some incompatibilities, I'm not exactly sure - YAML is a big standard.

I don't see how that change improves anything. If you give me one compelling reason, I'll think about that. "YAML does that" is not compelling, plus doing split by ---- is not harder anywhere than doing split by ---.

  • For compatibility saking: migration issues for example
  • for putting any data we want in the prologue: floats, hashes, etc.

In my case, I use pandoc as external tool which uses YAML standard. So I need to copy the headers for gostatic or for pandoc. If you use standard YAML headers, other tools could process files as well as gostatic at the same time.

That makes sense. I guess I'll try to get to that in next few days. :)

Perhaps you could take code from hugo which implements that

It's not hard to implement it, it's just I don't have enough time to sit and do that, but I'll have a few days off, so maybe then... :)