antwarjs / antwar

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

Support for directories in `posts` directory #17

Closed bebraw closed 9 years ago

bebraw commented 9 years ago

Ie. we should match against **/*.md. glob module is excellent for this purpose.

This will allow arbitrary layout for the directory. Note that there should be some way to define post ordering through configuration to make this sensible. Example:

antwar.config.js

module.exports = {
    sorting: function(a, b) {
         // see JS sort. both a and b contain regular post metadata after shaping through plugins
    },
};
bebraw commented 9 years ago

By the looks of it, maybe all we need to do is to enable recursive lookup for require.context at paths.js.

Given we have a plugin system in place now, we could implement one to parse date from post metadata. Even url slugifying mechanism could be moved outside. What if we allowed the user to override whole processPost and provide some sensible defaults? That would be the most flexible option here.

bebraw commented 9 years ago

Given we have a plugin system in place now, we could implement one to parse date from post metadata. Even url slugifying mechanism could be moved outside. What if we allowed the user to override whole processPost and provide some sensible defaults? That would be the most flexible option here.

Never mind. Just noticed that's possible already!

So I guess it might be just a matter of changing those flags.

eldh commented 9 years ago

Sounds good. Yeah, should be farily easy.