philips@ctrl-c.club
June 13 - 2015 at 21h
bake

EDIT: Better check out an updated guide for how to use bake in bake's github page overhere

As you probably know, I spent the last day or so writing an little cute tool called bake.

The idea behind it is very simple. You create a directory:

mkdir blog
cd blog

after this you create a bakefile file:

vim bakefile

and write something like this in it:

OUTPUT=/home/philips/public_html/index.html
TEMPLATE=template.html

then you create your template file:

vim template.html

and write a little html in it:

<!doctype HTML>

<html>
    <head>
        <title>Philips Personal Homepage</title>
        <style type="text/css">
            @import url(css/blog.css);
        </style>
    </head>

    <body>
        <div class="bar">
            Philips Personal Homepage
        </div>

        <div class="page">
            {
            <div class="space"></div>
            <div class="post">
                <div class="content">
                    <div class="title">{posttitle}</div>

                    {posttext}
                </div>
            </div>
            }
        </div>
    </body>
</html>

The {} delimits what code should be used for each post. {posttitle} will be replaced with the post title (I know, it's a bit hard to simply look at posttitle and understand this, so I'm helping you :P). And posttext will be replaced by the post text.

That's it, after that, when you want to create a blog post, you simply make a .markdown file (YEAH! IT SUPPORTS MARKDOWN!) in the same directory:

vim post-title-goes-here.markdown

And you are done. Just run bake.

bake