on master help sign in
Recommend Stack in installation/basics tutorials
d94ada5Harry Garrood
web/tutorials/01-installation.markdown+11−21
@@ -6,17 +6,13 @@ author: Jasper Van der Jeugt
6Installation
6Installation
7------------
7------------
8
8
9−Installation is provided using [cabal], and some packages are available for
9+Installation is provided via Hackage, and some packages are available for
10−different distributions.
10+different distributions. For installation from source (i.e. via Hackage),
11+[stack] is recommended:
11
12
12− $ cabal install hakyll
13+ $ stack install hakyll
13
14
14−[cabal]: http://www.haskell.org/cabal/
15+[stack]: http://www.haskellstack.org/
15−
16−If you have a recent installation of `cabal` and your time is somewhat valuable,
17−use:
18−
19− $ cabal install -j hakyll
20
16
21Linux distro packages:
17Linux distro packages:
22
18
@@ -34,27 +30,21 @@ started:
34This creates a folder `my-site` in the current directory, with some example
30This creates a folder `my-site` in the current directory, with some example
35content and a generic configuration.
31content and a generic configuration.
36
32
37−If `hakyll-init` is not found, you should make sure `$HOME/.cabal/bin` is in
33+If `hakyll-init` is not found, you should make sure your stack bin path
38−your `$PATH`.
34+(usually `$HOME/.local/bin`) is in your `$PATH`. You can check your stack local
39−
35+bin path by running `stack path --local-bin-path`.
40−(If you're on OS X you may not have a bin directory in `$HOME/.cabal`. In this
41−case, check `$HOME/Library/Haskell/bin` and put it on your path if you find
42−`hakyll-init` there. See [here] for more information on installation paths on
43−OS X.)
44−
45−[here]: http://www.haskell.org/haskellwiki/Mac_OS_X_Common_Installation_Paths
46
36
47The file `site.hs` holds the configuration of your site, as an executable
37The file `site.hs` holds the configuration of your site, as an executable
48haskell program. We can compile and run it like this:
38haskell program. We can compile and run it like this:
49
39
50 $ cd my-site
40 $ cd my-site
51− $ ghc --make -threaded site.hs
41+ $ stack build
52− $ ./site build
42+ $ stack exec site build
53
43
54If you installed `hakyll` with a preview server (this is the default), you can
44If you installed `hakyll` with a preview server (this is the default), you can
55now use
45now use
56
46
57− $ ./site watch
47+ $ stack exec site watch
58
48
59and have a look at your site at
49and have a look at your site at
60[http://localhost:8000/](http://localhost:8000/).
50[http://localhost:8000/](http://localhost:8000/).
web/tutorials/02-basics.markdown+11−11
@@ -7,24 +7,24 @@ Building and cleaning
7---------------------
7---------------------
8
8
9If you followed along with the previous tutorial, you should now have the
9If you followed along with the previous tutorial, you should now have the
10−example site up and running. By running `./site build`, you created two
10+example site up and running. By running `stack exec site build`, you created
11−directories:
11+two directories:
12
12
13- `_site`, with your site as HTML files, ready to be deployed;
13- `_site`, with your site as HTML files, ready to be deployed;
14- `_cache`, which Hakyll uses internally.
14- `_cache`, which Hakyll uses internally.
15
15
16−`./site clean` removes these directories, and `./site rebuild` performs a
16+`stack exec site clean` removes these directories, and `stack exec site
17−`clean` and then a `build`.
17+rebuild` performs a `clean` and then a `build`.
18
18
19−In general, you want to use `./site build` when you just made changes to the
19+In general, you want to use `stack exec site build` when you just made changes
20−contents of your website. If you made important changes to `site.hs`, you need
20+to the contents of your website. If you made changes to `site.hs`, you need to
21−to recompile `site.hs` followed by a rebuild:
21+recompile `site.hs` followed by a rebuild:
22
22
23− ghc --make site.hs
23+ stack build
24− ./site rebuild
24+ stack exec site rebuild
25
25
26−At this point, feel free to change some files, `./site build` and see what
26+At this point, feel free to change some files, `stack exec site build` and see
27−happens!
27+what happens!
28
28
29Pages and metadata
29Pages and metadata
30------------------
30------------------