picocms / Pico

Pico is a stupidly simple, blazing fast, flat file CMS.
http://picocms.org/
MIT License
3.81k stars 616 forks source link

Change the YAML header logic #586

Closed iaurman closed 3 years ago

iaurman commented 3 years ago

Every file has to contain a YAML header in order to be able to be recognized by pico.

---
Title: abc
---

Pico only sees it as a header, and doesn't render it in the webpage. But almost all markdown editors don't hide the YAML header. When I try to edit my pico .md file in my macbook, the header gets rendered. When I try to preview it, the first few lines get wasted by YAML header, instead of the actual content. And it's so annoying. I thought the purpose of using plain file instead of database is that my data and files don't get limited by one program.

Maybe make the header into Markdown Comment like this:

<!--
Title: abc
-->

Or make the YAML header into the Markdown Comment like this:

<!--
---
Title: abc
---
-->

Or offer an option to not use header while also being able to be recognized by pico. Just let the file name be the Title

PhrozenByte commented 3 years ago

YAML Front Matters are a very wide-spread concept, if a Markdown editor isn't capable of at least ignoring it, I would consider this an issue with the Markdown editor. Anyway, you can use the C-style block comment syntax as an alternative:

/*
Title: abc
*/