Questions tagged [hakyll]

A Haskell library for generating static websites

Named with a tip of the hat to , Hakyll is an open source library that generates small to medium sized static websites.

http://jaspervdj.be/hakyll/

79 questions
2
votes
1 answer

Sort Hakyll item list by a custom field

I want to add a custom field to my posts called coolness, like this: --- title: Something coolness: 10 --- and then I want to sort my posts by coolness. How do I do that? I know I can sort by date: posts <- recentFirst =<< loadAll "posts/*" using…
user3760874
  • 75
  • 1
  • 5
2
votes
1 answer

Custom content on a tags page

I have setup Hakyll to generate basic tag pages from blog posts as follows: main = do hakyll $ do match "preambles/*.md" $ compile $ pandocCompiler >>= relativizeUrls tags <- buildTags "posts/*.md" (fromCapture…
Nigel
  • 1,203
  • 2
  • 11
  • 20
2
votes
2 answers

How can I make this Haskell development environment in Nix?

I'm trying to make a Haskell development environment for a web project that just has the dependencies hakyll, blaze, and clay. Only, clay appears to fail to build, complaining that Setup: Encountered missing dependencies: hspec >=2.2.0 && <2.6,…
Jonathan
  • 10,571
  • 13
  • 67
  • 103
2
votes
2 answers

Conditionally including a field in the context based on each page’s metadata

I’d like to add a field to my Hakyll site’s context. If a certain key is present in the metadata then I’d like to transform the corresponding value and include that in the context. If the key is not present in the metadata then nothing should be…
bdesham
  • 15,430
  • 13
  • 79
  • 123
2
votes
0 answers

Minimal Hakyll site

I understand there's an example site given by hakyll-init app But I'm looking to reduce even more to the skeleton, and just have 1 markdown page that renders in the root, "localhost:8000/", and an alias "localhost:8000/index.html." From the…
Mittenchops
  • 18,633
  • 33
  • 128
  • 246
2
votes
1 answer

Hakyll: enabling pandoc extensions?

I wanted to enable the Ext_autolink_bare_uris pandoc extension for Hakyll posts. I followed the instructions given here, and everything seems to be working... except that extension! The bare URI's in posts are not transformed into a link. Everything…
wmnorth
  • 247
  • 4
  • 9
2
votes
1 answer

Hakyll not updating with new routes

I'm trying to use Hakyll for the first time. Following the tutorials on the official site, I'm trying to extend the route handling images to work with fonts. I've changed the code in site.hs to this: match ("images/*" .||. "fonts/*") $ do route…
Jules
  • 14,200
  • 13
  • 56
  • 101
2
votes
1 answer

M.Map sudden expected type error

Everything was working great up until about a month or so ago... Suddenly I'm getting berkson.github.io/source/blog.hs: 333, 42 • Couldn't match type ‘unordered-containers-0.2.7.1:Data.HashMap.Base.HashMap …
2
votes
1 answer

Hakyll says "Dependency cycle detected: ..."

I'm trying to construct a site with 7 pages. Each page is defined using a .markdown input. On each page I want a header with links to all the other pages. Now, this seems to be impossible since Hakyll tells me that I have a recursive…
nesqi
  • 97
  • 7
2
votes
0 answers

Building a Hakyll site in “development” or “release” mode

I am building a site with Hakyll and I only want my Google Analytics code to be included if I am deploying the site, not when I’m just testing it using “site server”. Ideally I’d be able to write something like $if(deploying)$
bdesham
  • 15,430
  • 13
  • 79
  • 123
2
votes
1 answer

Error resolving cabal dependencies on Travis-CI

I'm trying to build my Hakyll site using Travis-CI. However, before I even get that far, I have a dependencies error when trying to install Hakyll as a dependency. I can build Hakyll locally on my machine with no problems. What might be causing the…
jmite
  • 8,171
  • 6
  • 40
  • 81
2
votes
1 answer

Minimal cabal file for use in sandbox

I’m trying to write a project with the Hakyll library. In order to avoid messing up with my system, I’d install it in a cabal sandbox in the same folder where my Hakyll project lives. Being more or less a beginner, I’m still struggling with getting…
Debilski
  • 66,976
  • 12
  • 110
  • 133
1
vote
0 answers

How to use Hakyll.loadSnapshot without "No instance for (Typeable a0)" error

I'm trying to add some functionality to my site so that I can expose different versions of a post. For example, if my source directory contains mypost/version/1 mypost/version/2 mypost/version/3 I'd like to copy all of the versions of the post into…
Justin Manley
  • 249
  • 3
  • 12
1
vote
1 answer

Cannot install my Hakyll blog on Windows (issue with network library)

My Ubuntu laptop is dead. So I'm trying to install the Haskell projects for my Hakyll blog on Windows. I didn't change anything to the source code and the stack.yaml file, and I installed the Haskell platform. The library network fails to compile.…
Stéphane Laurent
  • 75,186
  • 15
  • 119
  • 225
1
vote
1 answer

gitlab-ci.yml file template for hakyll website project

Is there a hakyll template for GitLab gitlab-ci.yml? I found there are some on gitlab https://gitlab.com/jtojnar/hakyll https://gitlab.com/pages/hakyll I use the following file in the choice 2 image: haskell:latest before_script: - apt-get…
plasma
  • 287
  • 3
  • 12