on master help sign in
hakyll/web/tutorials/02-basics.markdown
49 lines 1.4 kB history raw
1---
2title: The basics
3author: Jasper Van der Jeugt
4type: main
5---
7Building and cleaning
8---------------------
10If you followed along with the previous tutorial, you should now have the
11example site up and running. By running `stack exec site build`, you created
12two directories:
14- `_site`, with your site as HTML files, ready to be deployed;
15- `_cache`, which Hakyll uses internally.
17`stack exec site clean` removes these directories, and `stack exec site
18rebuild` performs a `clean` and then a `build`.
20In general, you want to use `stack exec site build` when you just made changes
21to the contents of your website. If you made changes to `site.hs`, you need to
22recompile `site.hs` followed by a rebuild:
24 stack build
25 stack exec site rebuild
27At this point, feel free to change some files, `stack exec site build` and see
28what happens!
30Pages and metadata
31------------------
33You might've noticed that the markdown pages all start with a block:
35 ---
36 title: Contact
37 ---
39 I live...
41This is entirely optional, but useful for providing extra information
42("metadata") about items. All items can have metadata: since it's not really
43convenient to add such a header to an image, you can also do this using a
44separate file.
46For a file called `images/foo.png`, you can add an `images/foo.png.metadata`
47file with contents:
49 title: An image of a cow