Closed ttys3 closed 3 years ago
You can already use markdown for posts, as for example here. Thanks to TOML multiline strings, it's practically the same as writing a markdown file with a header, which you do with other generators.
There is no standard syntax to add a TOML header to a markdown file (as opposed to YAML, which Jekyll and Hugo use). Having pages in a widely supported standard format makes it easy to interopearate with plugins written in any language, which might get more supported in the future, and also easier for the users to get proper documentation and be certain what they write is correct.
it's not about TOML multiline strings.
using TOML to write a blog, is not friendly even to a programer
Jekyll / Hugo and even zola they all support YAML front matter
there's no standard format , but using toml is more difficult.
for example, I can migrate my Hugo based blog to zola with almost nearly no change.
even Github can preview the front matter prepended markdown without any problem.
but Github can not understand and render your toml based markdown
That's not true. When you use TOML header in Hugo, GitHub doesn't understand it at all - see here Using TOML is trivial, it's just key - value pairs. I migrated many pages to/from Zola/Hugo in a matter of minutes, it's really easy.
The supported markdown is CommonMark, which is the most standard format I am aware of, not any custom markdown syntax.
yes, Github doesn't understand TOML header, but do understand YAML header.
That would mean adding support for YAML. TOML was chosen for its simplicity (much easier to parse), as well as its being de facto standard config format in the Rust world, used in other generators like Zola. Thus adding support for YAML kind of goes against Blades' goals of minimality and simplicity. I can keep the issue open and consider it if there is more interest.
using TOML in Rust world as config file format has nothing to do with using YAML as markdown front-matter. this is two thing.
in fact, not only in Rust, I use TOML in many languages. but that's not a perfect reason for me to write blog in TOML
use TOML to write blog is friendly to Rust, not to human. but your tool is made for human
front-matter has no ISO standards or rfc. but, it just works good.
https://www.getzola.org/documentation/content/page/#path-from-frontmatter
https://gohugo.io/content-management/front-matter/
https://hexo.io/docs/front-matter.html
and the Zola author also prefer to TOML, they even don't like to write the YAML
font-matter support in the document.
but the code was added and the feature does exists.
they closed related issues again and again:
https://github.com/getzola/zola/issues/189
https://github.com/getzola/zola/issues/317
https://github.com/getzola/zola/issues/498
but finally they added the code. see https://github.com/getzola/zola/commit/4754cb5792a8864f5d808b71b9c43aee51343536
On the other hand, adding support for other formats should be quite straightforward, since all the structs already implement Deserialize
. The only issue I see is that the datetime format is different, but that could be handled.
It could be decided, based on the file extension, whether the given file is markdown with a front matter, YAML or TOML.
Feel free to open a PR :)
In 6cf90f09f98469d7cd95928a99b3bc370b804862, Blades was made to support .md
files with a TOML header delimited by +++
.
Furthermore, it is format agnostic now, so adding support for additional formats should be trivial now, if there is enough interest.
If yaml is supported, it will be a great help to migrate my previous blog.
I'am sorry if the description is not OK.
use toml to write blog seems a bit more "anti-human", if change to markdown, it will be very wonderful