@@ -3,46 +3,13 @@ title: Installation
33author: Jasper Van der Jeugt
44---
55
6−Why static websites?
7−--------------------
8−
9−Modern web frameworks make it easy to create huge dynamic websites. Why would
10−anyone still care about a static website?
11−
12−- Static websites are fast, because it's simply files served directly from the
13− hard disk.
14−- Static websites are secure. Nobody has ever found an SQL injection in static
15− pages.
16−- Static websites are easy to deploy. Just copy them to your webhost using
17− (S)FTP/rsync/scp and you are done. They work on all webhosts: no CGI or extra
18− modules needed for the web server.
19−
20−Why Hakyll?
21−-----------
22−
23−Hakyll is a [Haskell] library meant for creating small-to-medium sized static
24−websites. It is a powerful publishing tool, precisely because of the power of
25−Haskell. By using the awesome [pandoc] library, it is able to create your
26−website from a large variety of input formats.
27−
28−[Haskell]: http://haskell.org/
29−[pandoc]: http://johnmacfarlane.net/pandoc/
30−
31−Features include:
32−
33−- easy templating system;
34−- a simple HTTP server for previewing and compiling your website on the go;
35−- powerful syntax highlighting;
36−- modules for common items such as tags and feeds;
37−- easily extensible.
38−
396Installation
407------------
418
429Installation is provided using [cabal], and some packages are available for
4310different distributions.
4411
45− cabal install hakyll
12+ $ cabal install hakyll
4613
4714[cabal]: http://www.haskell.org/cabal/
4815
@@ -50,3 +17,30 @@ Linux distro packages:
5017
5118- [Archlinux (AUR)](https://aur.archlinux.org/packages/haskell-hakyll/)
5219- [Debian unstable](http://packages.debian.org/source/sid/haskell-hakyll)
20+
21+Building the example site
22+-------------------------
23+
24+Apart from the main Hakyll library, the cabal package also provided you with an
25+executable `hakyll-init` to create an example site. This is an easy way to get
26+started:
27+
28+ $ hakyll-init my-site
29+
30+If `hakyll-init` is not found, you should make sure `$HOME/.cabal/bin` is in
31+your `$PATH`.
32+
33+The file `site.hs` holds the configuration of your site, as an executable
34+haskell program. We can compile and run it like this:
35+
36+ $ cd my-site
37+ $ ghc --make site.hs
38+ $ ./site build
39+
40+If you installed `hakyll` with a preview server (this is the default), you can
41+now use
42+
43+ $ ./site preview
44+
45+and have a look at your site at
46+[http://localhost:8000/](http://localhost:8000/).