The Reichert Brothers Blog

Posted on February 7, 2014 by Christopher Reichert

Welcome to the Reichert Brothers Blog!

Reichert Brothers

We finally built it! Our hope is to give back to the software development community that we have learned so much from. We encounter a lot of peculiar problems throughout our hacking journey and we want to make this a forum to discussion related issues.

What is the blog built on?

This blog (and our entire site) is built on Hakyll, a static site generator written in Haskell.

Static sites are fast, secure, easy to deploy, and manageable using version control. — Hakyll documentation

If you don’t know any Haskell don’t be intimidated! The amount of Haskell code it takes to get up and running is quite minimal. The rest of this post will be a short tutorial on getting started with Hakyll. This is also covered in The Hakyll Documentation.

How can I build a Hakyll site?

Hakyll is simple to install if you are familiar with cabal:

    cabal install hakyll

Use the hakyll-init executable to generate an example site:

    hakyll-init foo

Then compile your site using ghc:

    cd foo
    ghc --make -threaded site.hs

You can now run the hakyll preview server to test the site:

    ./site preview

Your site should be visible at http://localhost:8000.

Not only does Hakyll provide the preview server, it also integrates extremely easily with NGinx, Apache, and other web servers. Use the build command to compile the site:

    ./site.hs build

This command creates a directory _site which contains the compiled site. NGinx, for example, can point directly to this using the root directive:

root /path/to/foo/_site;

Happy Hacking!


comments powered by Disqus