How to Update the Website
Clone this repo locally.
Compile the application with Nix or Stack.
./generate-nix-project.sh nix-shell ./shell.nix cabal build ./dist/build/site/site clean ./dist/build/site/site build ./dist/build/site/site watch
stack clean stack build stack exec site clean stack exec site build stack exec site watch
site.hs contains the rules used from Hakyll for generating the website. Every time you change them:
- recomplie the application
- clean the website with
for a live preview of the website. In case of change of files, the preview is updated.
Adding a Post
Add posts inside
posts/ directory, in the proper subdirector, playing the role of category.
Use already defined posts as example. Hakyll uses Pandoc that is very powerful and many different type of files are accepted.
It is convenient to have an excerpt of a post displayed on the index page along with a “Read more…” link to encourage your readers to read the rest of the post. For doing this put the teaser symbol where the excerpt end.
In case of Literate Haskell Code use instead
for bypassing the byrding style
Use something like
<img src="/images/photos/meetup_2015_estate.jpg" alt="photo" class="img-thumbnail">
on the first column of a Markdown file. Pandoc will insert directly the HTML code. The class is used from Bootstrap CSS template for scaling and decorating the image.
Change Top Menu
Change the function
Change Page Format
Change all files in templates directory. Same format is repeated for:
- blog post
Change "About" Page
for updating the
_site/ directory. In case of big changes it is better a
site clean site build
Then make a Git commit, and push to the remote repo.
git status git add <missing-files> git commit -a -m "<some-message>" git push
The hosting server will make a pull, and publish the content of
_site/ directory, without the generated HTML pages.
The repo is automatically synced once an hour on gitlab.com, where a build is triggered if there are new commits, the HTML pages are generated, and the public website http://www.haskell-ita.it is updated within 1-2 hours.
If you miss the tag
author Hakyll generates a not clear error message like:
[ERROR] Missing field $posts$ in context for item 3/index.html
In case of community pages uses
community as author.