Skip to content

hoichi/chops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chops

The lean mean static... builder... thing. NOT ready for production. Or for showing to anybody. But there it is.

The what now?

Chops is 50% a learning project and 50% a Jekyll killer. Well, it’s not supposed to replace Jekyll. On a code-configuration scale it’s much closer to Gulp than to, say, Brunch. Here’s an idea of its API:

 let collections = {
    blog: chops.collection()
        .order('created_at', 'desc')
        .render(templates.get('blog'))
        .dest('blog/index.html')
    ,
    rss: chops.collection()
        .order('created_at', 'desc')
        .first(10)
        .render(templates.get('rss'))
        .dest('feed.xml')
    };

    site.src(`blog/!**!/!*.@(md|mdown|markdown`)    // this returns empty meta and raw content
        .yfm()  // this strips yfm and fills meta
        .parse(s => md.convert(s))
        .meta((meta, path) => {})
        .collect([
            collections.blog,
            collections.rss
        ])
        .render(templates.get('single'))
    .dest('blog/');

    site.src('...')
        .patchData(
            ({content}) => {
                 let {attributes, body} = fm(content);
                 return {meta: attributes, content: body}
            },
            ({content}) => {
                return {content: md.convert(content)};
            }
        )
        .collect(coll['blog'])
        .render(templates['post'])
    .dest();

Meaning the engine should give you as much manual control as humanly possible. Whether or not I should write something that uses the engine but works right out of the box is a story for another day. First I should write the engine itself.

About

A watchful static site builder (work in progress)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published