[web-devel] Using Hamlet for a static website

Jasper Van der Jeugt jaspervdj at gmail.com
Mon May 30 21:21:50 CEST 2011


Hello,

Hakyll [1] is a static website compiler which supports Hamlet
templates. Pages can be written in plain HTML or any other format that
Pandoc supports. It sounds a lot like what you're looking for.

[1]: http://jaspervdj.be/hakyll/

Cheers,
Jasper

On Mon, May 30, 2011 at 9:17 PM, Neil Mitchell <ndmitchell at gmail.com> wrote:
> Hi,
>
> My website at http://community.haskell.org/~ndm/ is based on lots of
> template files, for example:
> http://community.haskell.org/~ndm/darcs/website/pages/catch.html (not
> a real HTML file, but a partial HTML file).
>
> These files all start with some metadata, and then have some templated
> language below, which gets combined with headers/footers to produce my
> website. I did this all using custom code, but I'd like to move to
> using Hamlet with YAML, so I can throw away lots of my custom code and
> so I get lots of additional features I'm currently missing because I
> have to hand-roll the framework myself. I couldn't find any examples
> of anything else doing this, so two questions:
>
> 1) I couldn't find any easy way to say "run hamlet on each of the
> files in this directory"? Will I have to do a getDirectoryContents in
> IO, lift that into Q, and then statically call hamletFile on a list?
> Then I'll output the HTML to file.
>
> 2) Is there an existing example of this? Writing a static site in
> terms of Hamlet seems like a nice idea, and I can't be the first to
> have thought of it.
>
> Thanks, Neil
>
> _______________________________________________
> web-devel mailing list
> web-devel at haskell.org
> http://www.haskell.org/mailman/listinfo/web-devel
>



More information about the web-devel mailing list