hakyll, haskell, hledger, ops
June 7, 2013

Blog tinkering, hledger.org

A better ghci fix

I forgot to commit last night’s ghci fix, which is good because I improved it today, fixing the code duplication.

Blog tinkering

Thanks to help from #hakyll, I spent some time figuring out how to safely update published blog posts without having them reappear as new on Planet Haskell. The problem seemed to be that I wasn’t setting a separate updated date, which caused the published date to change, which caused the post to reappear as new, at least in my feed reader.

Solution: Start blog posts with metadata like this:

---
title:     6/6
author:    Simon Michael
published: 2013-06-06 16:00:00PDT
updated:   2013-06-06 17:00:00PDT
---

hledger.org

Worked on the next hledger backlog item, improving the website update process. Did some file cleanup and testing.

I found that I had broken hledger.org several days ago, when I gratuitously enhanced:

RewriteRule ^/bugs?/?$   https://github.com/simonmichael/hledger/issues [L,NE]

to:

RewriteRule ^/(bugs|issues)?/?$   https://github.com/simonmichael/hledger/issues [L,NE]

Doh. Fixed it:

RewriteRule ^/(bugs?|issues)/?$   https://github.com/simonmichael/hledger/issues [L,NE]

Next: yes, the cron job for updating the site is reporting an error - though it seems to successfully update the site all the same:

From github.com:simonmichael/hledger
   47ebc21..e87f492  master     -> origin/master
Updating 47ebc21..e87f492
Fast-forward
 README.md |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
cd site; ghc site.hs -L/usr/lib -package-db ~/src/joyful.com/cabal-dev/packages-*.conf
cd site; ./site build
Initialising...
  Creating store...
  Creating provider...
  Running rules...
Checking for out-of-date items
Compiling
site: _site/README.html: commitBuffer: invalid argument (invalid character)
  updated README.md
make: *** [site] Error 1

Re-enabling export LANG=en_US.UTF-8 in the Makefile seems to have fixed it. I have a non-ascii character in the site footer. Setting the LANG environment variable is the quick way to configure a locale, which used to be very much required to avoid encoding errors with GHC 6, but which I thought was less necessary with GHC 7. Perhaps not.