Edison

Jekyll is nice, but doesn't give you much flexibility. Everything is a post! What if you want a static site with multiple types of objects?

Enter Edison.

$ cat <<END > _config.rb
Edison.config do
    models.posts.each do |post|
        Edison::Helpers.date_from_filename(post)
        post.url = "posts/#{post._fname}"
        routes.url File.join(post.url, "index.html"), "post", post
    end

    routes.url "index.html" do |data|
        data.posts = models.posts
    end
end
END

$ mkdir -p _models/posts
$ cat <<END > _models/posts/$(date +%Y-%m-%d)-my-first-post.md
---
title: My first post!
---
I'm blogging on [Edison](http://github.com/michaelmaltese/edison)!
END

$ mkdir _views
$ cat <<END > _views/post.html
<h1>{{ title }}</h1>
<em>{{ date }}</em>
{{{ body }}}
END

$ cat <<END > index.html
<h1>An Edison Blog</h1>
<ul>
    {{# posts}}
        <li><a href="{{ url }}">{{ title }}</a></li>
    {{/ posts}}
</ul>
END

$ edison serve
Running in /Users/michaelmaltese/edison-example...
Loading model posts/2013-03-17-my-first-post.md...
Loading view _views/post.html...
Copying static files...
Creating /index.html...
Creating /posts/2013-03-17-my-first-post/index.html...
Done!
[2013-03-17 17:36:47] INFO  WEBrick 1.3.1
[2013-03-17 17:36:47] INFO  ruby 1.8.7 (2012-02-08) [universal-darwin11.0]
[2013-03-17 17:36:48] INFO  WEBrick::HTTPServer#start: pid=28835 port=4000

Mustache, Markdown, and YAML keep you nice and clean.