on master help sign in
Merge pull request #411 from hdgarrood/use-stack

Recommend Stack in installation/basics tutorials

commit43b1cb137d884e7cee94ed1a490650daacbb50d4 authorJasper Van der Jeugt <jaspervdj@gmail.com> dateMon 28 Mar 2016, 11:15 (11 years ago) parentd5b3160d94ada5
2 files changed+22−32
web/tutorials/01-installation.markdown+11−21 web/tutorials/02-basics.markdown+11−11
web/tutorials/01-installation.markdown+11−21
@@ -6,17 +6,13 @@ author: Jasper Van der Jeugt
66Installation
77------------
88
9−Installation is provided using [cabal], and some packages are available for
10−different distributions.
9+Installation is provided via Hackage, and some packages are available for
10+different distributions. For installation from source (i.e. via Hackage),
11+[stack] is recommended:
1112
12− $ cabal install hakyll
13+ $ stack install hakyll
1314
14−[cabal]: http://www.haskell.org/cabal/
15−
16−If you have a recent installation of `cabal` and your time is somewhat valuable,
17−use:
18−
19− $ cabal install -j hakyll
15+[stack]: http://www.haskellstack.org/
2016
2117Linux distro packages:
2218
@@ -34,27 +30,21 @@ started:
3430This creates a folder `my-site` in the current directory, with some example
3531content and a generic configuration.
3632
37−If `hakyll-init` is not found, you should make sure `$HOME/.cabal/bin` is in
38−your `$PATH`.
39−
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
33+If `hakyll-init` is not found, you should make sure your stack bin path
34+(usually `$HOME/.local/bin`) is in your `$PATH`. You can check your stack local
35+bin path by running `stack path --local-bin-path`.
4636
4737The file `site.hs` holds the configuration of your site, as an executable
4838haskell program. We can compile and run it like this:
4939
5040 $ cd my-site
51− $ ghc --make -threaded site.hs
52− $ ./site build
41+ $ stack build
42+ $ stack exec site build
5343
5444If you installed `hakyll` with a preview server (this is the default), you can
5545now use
5646
57− $ ./site watch
47+ $ stack exec site watch
5848
5949and have a look at your site at
6050[http://localhost:8000/](http://localhost:8000/).
web/tutorials/02-basics.markdown+11−11
@@ -7,24 +7,24 @@ Building and cleaning
77---------------------
88
99If 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
11−directories:
10+example site up and running. By running `stack exec site build`, you created
11+two directories:
1212
1313- `_site`, with your site as HTML files, ready to be deployed;
1414- `_cache`, which Hakyll uses internally.
1515
16−`./site clean` removes these directories, and `./site rebuild` performs a
17−`clean` and then a `build`.
16+`stack exec site clean` removes these directories, and `stack exec site
17+rebuild` performs a `clean` and then a `build`.
1818
19−In general, you want to use `./site build` when you just made changes to the
20−contents of your website. If you made important changes to `site.hs`, you need
21−to recompile `site.hs` followed by a rebuild:
19+In general, you want to use `stack exec site build` when you just made changes
20+to the contents of your website. If you made changes to `site.hs`, you need to
21+recompile `site.hs` followed by a rebuild:
2222
23− ghc --make site.hs
24− ./site rebuild
23+ stack build
24+ stack exec site rebuild
2525
26−At this point, feel free to change some files, `./site build` and see what
27−happens!
26+At this point, feel free to change some files, `stack exec site build` and see
27+what happens!
2828
2929Pages and metadata
3030------------------