antwarjs / antwar

A static site generator built with React and Webpack.
https://antwar.js.org/
MIT License
460 stars 35 forks source link

Extract post formatting (YAML headmatter + Markdown) from core #51

Closed bebraw closed 9 years ago

bebraw commented 9 years ago

In general it should be possible to author posts in whatever format you like. We can provide some defaults at boilerplates but it should be able to complement/replace those with other solutions.

The main benefit here is that you can apply additional loaders (ie. highlight) on content easily if we do this.

The only problem I see here is that YAML headmatter has a special purpose in our system (gets parsed and passed to post template) so that might take some thinking. I guess if it exists, we'll inject the data. Otherwise just skip it.

eldh commented 9 years ago

If we allow plugins to override which loaders are used, and also override post parsing then this shouldn't be that tricky to do. But interoperability with other plugins become harder if we can't guarantee what will be passed in preProcess and postProcess hooks. So I'd vote for being a bit opinionated here. highlighting etc can pretty easily be done in postProcessing.

eldh commented 9 years ago

We can also override each step of the post processing with plugins (url, content etc)

iamstarkov commented 9 years ago

In general it should be possible to author posts in whatever format you like.

what do you mean by this?

iamstarkov commented 9 years ago

one of the reason why I left jekyll bloging is mandatory of yaml header, while we can extract almost everything from raw content of markdown article. Title, date, desc, image, content (text nodes in text and in html) it’s all extractable from my perspective

iamstarkov commented 9 years ago

So the question is do you really want to force everybody to use yaml headers or it is not mandatory?

bebraw commented 9 years ago

This issue is actually obsolete. We aren't dependent on Markdown anymore. If YAML headmatter exists we'll parse that but it doesn't matter if it's missing.