on master help sign in
hakyll/web/tutorials/01-installation.markdown
54 lines 1.6 kB history raw
1---
2title: Installation
3author: Jasper Van der Jeugt
4type: main
5---
7Installation
8------------
10Installation is provided via Hackage, and some packages are available for
11different distributions. For installation from source (i.e. via Hackage),
12[stack] is recommended:
14 $ stack install hakyll
16[stack]: http://www.haskellstack.org/
18Linux distro packages:
20- [Debian unstable](http://packages.debian.org/source/sid/haskell-hakyll)
21- [Fedora](https://apps.fedoraproject.org/packages/ghc-hakyll)
22- [Nix](https://nixos.org/nixos/packages.html#hakyll): `$ nix-env -i hakyll`
24Building the example site
25-------------------------
27Apart from the main Hakyll library, the cabal package also provides you with an
28executable `hakyll-init` to create an example site. This is an easy way to get
29started:
31 $ stack exec hakyll-init my-site
33This creates a folder `my-site` in the current directory, with some example
34content and a generic configuration.
36If `hakyll-init` is not found, you should make sure your stack bin path
37(usually `$HOME/.local/bin`) is in your `$PATH`. You can check your stack local
38bin path by running `stack path --local-bin`.
40The file `site.hs` holds the configuration of your site, as an executable
41haskell program. We can compile and run it like this:
43 $ cd my-site
44 $ stack init # creates stack.yaml file based on my-site.cabal
45 $ stack build
46 $ stack exec site build
48If you installed `hakyll` with a preview server (this is the default), you can
49now use
51 $ stack exec site watch
53and have a look at your site at
54[http://localhost:8000/](http://localhost:8000/).