hakyll/web/tutorials/01-installation.markdown

62 lines
1.7 KiB
Markdown
Raw Normal View History

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
---
Installation
------------
Installation is provided using [cabal], and some packages are available for
different distributions.
2012-12-14 09:42:30 +00:00
$ cabal install hakyll
[cabal]: http://www.haskell.org/cabal/
2012-12-05 17:13:20 +00:00
2012-12-17 16:50:36 +00:00
If you have a recent installation of `cabal` and your time is somewhat valuable,
use:
$ cabal install -j hakyll
2012-12-05 17:13:20 +00:00
Linux distro packages:
- [Archlinux (AUR)](https://aur.archlinux.org/packages/haskell-hakyll/)
- [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
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.
If `hakyll-init` is not found, you should make sure `$HOME/.cabal/bin` is in
2013-04-29 13:15:41 +00:00
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
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
$ ghc --make site.hs
$ ./site build
If you installed `hakyll` with a preview server (this is the default), you can
now use
$ ./site watch
2012-12-14 09:42:30 +00:00
and have a look at your site at
[http://localhost:8000/](http://localhost:8000/).