2011-06-13 16:26:04 +00:00
|
|
|
---
|
|
|
|
title: Installation
|
2011-10-09 10:36:35 +00:00
|
|
|
author: Jasper Van der Jeugt
|
2011-06-13 16:26:04 +00:00
|
|
|
---
|
|
|
|
|
2012-03-26 13:05:49 +00:00
|
|
|
Installation
|
|
|
|
------------
|
|
|
|
|
2016-03-16 21:21:15 +00:00
|
|
|
Installation is provided via Hackage, and some packages are available for
|
|
|
|
different distributions. For installation from source (i.e. via Hackage),
|
|
|
|
[stack] is recommended:
|
2012-03-26 13:05:49 +00:00
|
|
|
|
2016-03-16 21:21:15 +00:00
|
|
|
$ stack install hakyll
|
2012-03-26 13:05:49 +00:00
|
|
|
|
2016-03-16 21:21:15 +00:00
|
|
|
[stack]: http://www.haskellstack.org/
|
2012-12-17 16:50:36 +00:00
|
|
|
|
2012-12-05 17:13:20 +00:00
|
|
|
Linux distro packages:
|
|
|
|
|
|
|
|
- [Debian unstable](http://packages.debian.org/source/sid/haskell-hakyll)
|
2012-12-14 09:42:30 +00:00
|
|
|
|
|
|
|
Building the example site
|
|
|
|
-------------------------
|
|
|
|
|
2013-04-29 13:03:57 +00:00
|
|
|
Apart from the main Hakyll library, the cabal package also provides you with an
|
2012-12-14 09:42:30 +00:00
|
|
|
executable `hakyll-init` to create an example site. This is an easy way to get
|
|
|
|
started:
|
|
|
|
|
|
|
|
$ hakyll-init my-site
|
|
|
|
|
2013-02-10 10:05:37 +00:00
|
|
|
This creates a folder `my-site` in the current directory, with some example
|
2013-04-29 13:03:57 +00:00
|
|
|
content and a generic configuration.
|
|
|
|
|
2016-03-16 21:21:15 +00:00
|
|
|
If `hakyll-init` is not found, you should make sure your stack bin path
|
|
|
|
(usually `$HOME/.local/bin`) is in your `$PATH`. You can check your stack local
|
2016-07-23 10:06:42 +00:00
|
|
|
bin path by running `stack path --local-bin`.
|
2012-12-14 09:42:30 +00:00
|
|
|
|
|
|
|
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
|
2016-07-23 10:14:31 +00:00
|
|
|
$ stack init # creates stack.yaml file based on my-site.cabal
|
2016-03-16 21:21:15 +00:00
|
|
|
$ stack build
|
|
|
|
$ stack exec site build
|
2012-12-14 09:42:30 +00:00
|
|
|
|
|
|
|
If you installed `hakyll` with a preview server (this is the default), you can
|
|
|
|
now use
|
|
|
|
|
2016-03-16 21:21:15 +00:00
|
|
|
$ stack exec site watch
|
2012-12-14 09:42:30 +00:00
|
|
|
|
|
|
|
and have a look at your site at
|
|
|
|
[http://localhost:8000/](http://localhost:8000/).
|