summaryrefslogtreecommitdiff
path: root/web/tutorials/01-installation.markdown
blob: 5421c739ec7c0e0544663ec2617c16d8c6906281 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
title: Installation
author: Jasper Van der Jeugt
---

Installation
------------

Installation is provided using [cabal], and some packages are available for
different distributions.

    $ cabal install hakyll

[cabal]: http://www.haskell.org/cabal/

If you have a recent installation of `cabal` and your time is somewhat valuable,
use:

    $ cabal install -j hakyll

Linux distro packages:

- [Archlinux (AUR)](https://aur.archlinux.org/packages/haskell-hakyll/)
- [Debian unstable](http://packages.debian.org/source/sid/haskell-hakyll)

Building the example site
-------------------------

Apart from the main Hakyll library, the cabal package also provides you with an
executable `hakyll-init` to create an example site. This is an easy way to get
started:

    $ hakyll-init my-site

This creates a folder `my-site` in the current directory, with some example
content and a generic configuration.

If `hakyll-init` is not found, you should make sure `$HOME/.cabal/bin` is in
your `$PATH`.

(If you're on OS X you may not have a bin directory in `$HOME/.cabal`. In this
case, check `$HOME/Library/Haskell/bin` and put it on your path if you find
`hakyll-init` there. See [here] for more information on installation paths on
OS X.)

[here]: http://www.haskell.org/haskellwiki/Mac_OS_X_Common_Installation_Paths

The file `site.hs` holds the configuration of your site, as an executable
haskell program. We can compile and run it like this:

    $ cd my-site
    $ ghc --make -threaded site.hs
    $ ./site build

If you installed `hakyll` with a preview server (this is the default), you can
now use

    $ ./site watch

and have a look at your site at
[http://localhost:8000/](http://localhost:8000/).