Hey Jasper,
Just getting started with Hakyll. Looking good so far but I had a similar problem to OP.
OP, after trying for a few hours, I can't seem to find why your code is not working.
@Jasper, one problem I did find though is that dateField at least currently doesn't actually support using the published or date metadata fields to get the date. Reproduction steps are as follows:
1. Make example site.
2. Delete the date prefix in one of the markdown post's filename.
3. Add the follow lines below the title metadata
---
published: 2012-07-07
---
4. Try to rebuild the site. Will error with "missing field $date$ for item posts/(whatever file you modified)"
I've added the bug to the issue tracker on GitHub.
Also, I would like a mention of this point in the tutorial. I'm all for defaults over configuration but they should be mentioned. I would like this mentioned in the tutorial especially because making new posts and new fields based on posts are key elements in copying/extending tutorial example.
I found the problem extremely frustrating because the problem has nothing to do with code or templates. Just the file name. Also the examples/documentation often say something like "posts/foo.markdown" which obviously will not just drop into the example site.
Thank you for Hakyll though! I'm really enjoying learning more about the system but I felt that this was a surprise gotcha that really frustrated me.
Ward regards,
David Flicker