Replace Hakyll with Zodiac

There is no caching of Hakyll compilation between CI builds and as a
result the builds time out (there are also other build-related
problems). Zodiac is a much more lightweight solution.
parent 95efc38d
Pipeline #23232772 passed with stages
in 2 minutes and 31 seconds
image: haskell:latest
image: alpine:latest
- apt-get update && apt-get install xz-utils make
- export STACK_ROOT=`pwd`/.stack
- stack setup
- stack install --only-dependencies
- stack build
- apk update
# We install GNU awk as there is an issue with BusyBox’s awk:
- apk add gawk make
- make -C zodiac install
- _cache
- .stack
- stack exec site build
- make
- master
- _cache
- .stack
- stack exec site build
- make
- public
[submodule "zodiac"]
path = zodiac
url =
.PHONY: all clean
all: clean public
zod src public
rm -rf public
mkdir public
# Ercoin’s web site
## Installation
## Requirements
1. Install [Haskell Stack](
2. `stack build`
1. [Zodiac]( Linked as a Git submodule for convenience and version pinning, it needs to be installed.
2. make.
3. awk. If having trouble with a particular implementation, you may use [gawk](
## Building
stack exec site rebuild
## Live server with automatic reloading
The site will be generated to the `public/` directory.
To remove generated files:
stack exec site watch
make clean
name: ercoin-site
build-type: Simple
cabal-version: >= 1.10
executable site
main-is: site.hs
build-depends: base == 4.*
, hakyll == 4.12.*
ghc-options: -threaded
default-language: Haskell2010
{-# LANGUAGE OverloadedStrings #-}
import Data.Monoid (mappend)
import Hakyll
config :: Configuration
config = defaultConfiguration {
destinationDirectory = "public"
main :: IO ()
main = hakyllWith config $ do
match "images/*" $ do
route idRoute
compile copyFileCompiler
match "css/*" $ do
route idRoute
compile compressCssCompiler
match "posts/*" $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/post.html" postCtx
>>= loadAndApplyTemplate "templates/default.html" postCtx
>>= relativizeUrls
create ["archive.html"] $ do
route idRoute
compile $ do
posts <- recentFirst =<< loadAll "posts/*"
let archiveCtx =
listField "posts" postCtx (return posts) `mappend`
constField "title" "Archives" `mappend`
makeItem ""
>>= loadAndApplyTemplate "templates/archive.html" archiveCtx
>>= loadAndApplyTemplate "templates/default.html" archiveCtx
>>= relativizeUrls
match "index.html" $ do
route idRoute
compile $ do
let indexCtx =
-- We don’t use default context to not have title field.
bodyField "body" `mappend`
metadataField `mappend`
urlField "url" `mappend`
pathField "path" `mappend`
>>= applyAsTemplate indexCtx
>>= loadAndApplyTemplate "templates/default.html" indexCtx
>>= relativizeUrls
match "templates/*" $ compile templateBodyCompiler
postCtx :: Context String
postCtx =
dateField "date" "%B %e, %Y" `mappend`
......@@ -3,8 +3,8 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Ercoin $if(title)$— $title$$endif$</title>
<link rel="stylesheet" href="/css/default.css" />
<link rel="stylesheet" href="/style.css" />
......@@ -18,15 +18,8 @@
<a href="/#bounties">Bounties</a>
<main role="main">
Site proudly generated by
<a href="">Hakyll</a>
# This file was automatically generated by 'stack init'
# Some commonly used options have been documented as comments in this file.
# For advanced use and comprehensive documentation of the format, please see:
# Resolver to choose a 'specific' stackage snapshot or a compiler version.
# A snapshot resolver dictates the compiler version and the set of packages
# to be used for project dependencies. For example:
# resolver: lts-3.5
# resolver: nightly-2015-09-21
# resolver: ghc-7.10.2
# resolver: ghcjs-0.1.0_ghc-7.10.2
# resolver:
# name: custom-snapshot
# location: "./custom-snapshot.yaml"
resolver: lts-11.11
# User packages to be built.
# Various formats can be used as shown in the example below.
# packages:
# - some-directory
# -
# - location:
# git:
# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a
# - location:
# extra-dep: true
# subdirs:
# - auto-update
# - wai
# A package marked 'extra-dep: true' will only be built if demanded by a
# non-dependency (i.e. a user package), and its test suites and benchmarks
# will not be run. This is useful for tweaking upstream packages.
- '.'
# Dependency packages to be pulled from upstream that are not in the resolver
# (e.g., acme-missiles-0.3)
extra-deps: []
# Override default flag values for local packages and extra-deps
flags: {}
# Extra package databases containing global packages
extra-package-dbs: []
# Control whether we use the GHC we find on the path
# system-ghc: true
# Require a specific version of stack, using version ranges
# require-stack-version: -any # Default
# require-stack-version: ">=1.4"
# Override the architecture used by stack, especially useful on Windows
# arch: i386
# arch: x86_64
# Extra directories used by stack for building
# extra-include-dirs: [/path/to/dir]
# extra-lib-dirs: [/path/to/dir]
# Allow a newer minor version of GHC than the snapshot specifies
# compiler-check: newer-minor
Here you can find all my previous posts:
<a href="$url$">$title$</a> - $date$
<section class="header">
Posted on $date$
by $author$
Subproject commit 7515f68a8d8f2f0345c80874b34eeedddd3407da
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment