Hakyll Website Manual

Build

To build and run:

  • stack build Build the site generator
  • stack exec site build Generate the website (stored in _site)
  • stack exec site watch Dev server with live reload

After changes to Site.hs:

  • stack exec site rebuild

The site generator compiles Markdown posts and pages with Pandoc, applies templates, and outputs static HTML to _site/. Posts are dated by filename (YYYY-MM-DD-slug.md) and automatically sorted by date on the index and archive pages.

File Watchers

There are two scripts:

  1. refresh.sh - builds and starts Hakyll’s watch server on port 8000
  2. watch-archive.sh - watches /Users/carlson/Desktop/ARCHIVE and runs refresh.sh on changes

To run them:

Terminal 1: Start the site watcher

sh refresh.sh

Terminal 2: Start the archive watcher (watches Desktop/ARCHIVE)

sh watch-archive.sh

Note: watch-archive.sh watches /Users/carlson/Desktop/ARCHIVE. This is where the app The Archive stores its files.