Skip to content

Haskell-ITA/www_haskell-ita_it_website

Repository files navigation

build status

How to Update the Website

Initial Setup

Clone this repo locally.

Compile the application with Nix or Stack.

Nix Instructions

Execute

./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 Instructions

Execute

stack clean
stack build
stack exec site clean
stack exec site build
stack exec site watch

Website Configuration

The file site.hs contains the rules used from Hakyll for generating the website. Every time you change them:

  • recomplie the application
  • clean the website with site clean

Website Preview

Execute

site watch

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.

Teaser

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.

<!--more-->

In case of Literate Haskell Code use instead

<div></div><!--more-->

for bypassing the byrding style > character.

Images

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 renderTagListForTopMenu inside site.hs

Change Page Format

Change all files in templates directory. Same format is repeated for:

  • blog-list
  • blog post
  • page

Change "About" Page

Change about.md file.

Website Update

Execute

site build

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.

Known Problems

If you miss the tag date, and 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.