Is there a YAML front matter standard / validator?

后端 未结 1 1474
小鲜肉
小鲜肉 2020-12-30 08:41

I would like to use YAML front matter as a metadata holder for a general purpose data manager, e.g.:

---
layout: \"user\"
title: \"Mario Bre         


        
相关标签:
1条回答
  • 2020-12-30 09:29

    The closest thing to a standard would be Jekyll's Front Matter description. Everything else seems to follow that. If Jekyll didn't invent Yaml Front Matter, they were one of the first notable projects to feature it.

    The YAML Lint linter has been able to verify the YAML components of every file I've thrown at it. According to the YAML spec, three-hyphens --- delimits documents; a single YAML file can contain many YAML documents. The Markdown content after the hyphen is simply dropped by the linter.

    YAML is very loose and forgiving (mostly). Quoting all your strings won't hurt, but you probably don't need to bother.

    The desire for some sort of baseline Markdown standard is what led to the CommonMark project.

    So, while there is no formal specification, a pattern of best practices has emerged. Sticking to that pattern results in some surprisingly portable and versatile data files.

    0 讨论(0)
提交回复
热议问题