Users of Hamlet templates in Hakyll

229 views
Skip to first unread message

Jasper Van der Jeugt

unread,
Aug 13, 2011, 10:52:16 AM8/13/11
to hakyll, web-devel
Hello all,

I've been thinking of powering up the template system in Hakyll a bit
lately. However, the current support for Hamlet templates makes this a
hard task. I was even thinking of dropping Hamlet support entirely for
two reasons:

- the runtime bindings seem to be available no more in the latest
release of hamlet, making Hakyll dependent on an older Hamlet version;
- the mismatches between the two formats.

Obviously, I don't want to break any sites, so I would like to hear if
anyone is currently using this feature, and what their opinions are.

Cheers,
Jasper

Gwern Branwen

unread,
Aug 13, 2011, 11:42:06 AM8/13/11
to hak...@googlegroups.com
On Sat, Aug 13, 2011 at 10:52 AM, Jasper Van der Jeugt <m...@jaspervdj.be> wrote:
>
> Obviously, I don't want to break any sites, so I would like to hear if
> anyone is currently using this feature, and what their opinions are.

What is the Hamlet templating? Is this the $description$ and $title$
stuff in the HTML skeleton files? If it is, I am most certainly using
it!

--
gwern
http://www.gwern.net

Greg Weber

unread,
Aug 13, 2011, 11:16:42 AM8/13/11
to Jasper Van der Jeugt, hakyll, web-devel
Hi Jasper,

I use the Hamlet templates, although I am planning on staying on Hakyll 1 since it is meeting my needs.

What are you referring to as the mismatch between the two formats? Are you referring to the old syntax that used '%' and '!'? That is very deprecated now. I am using the new hamlet syntax for my blog.

Michael is on vacation for a few days, but he can better answer about runtime support.

Greg Weber

_______________________________________________
web-devel mailing list
web-...@haskell.org
http://www.haskell.org/mailman/listinfo/web-devel

Jasper Van der Jeugt

unread,
Aug 13, 2011, 1:15:06 PM8/13/11
to hak...@googlegroups.com, web-devel
> Michael is on vacation for a few days, but he can better answer about runtime support.

Good point!

> What is the Hamlet templating? Is this the $description$ and $title$
> stuff in the HTML skeleton files? If it is, I am most certainly using
> it!

No, those are the Hakyll templates (which is more or less the
default). The Hamlet templates are an extension which allows you to
use a HAML-like syntax in templates. You enable them by using
`.hamlet` templates instead of `.html` templates -- I'm sorry if I
caused any confusion.

Cheers,
Jasper

Michael Snoyman

unread,
Aug 13, 2011, 3:30:36 PM8/13/11
to Jasper Van der Jeugt, hak...@googlegroups.com, web-devel
The runtime support was dropped in the last release. I put out an
email asking if anyone used it still, and didn't get any responses, so
I thought it was just unused bits floating around. Anyway, if you're
interesting in continuing support for runtime Hamlet, I think it would
make sense to try to create a separate hamlet-rt package, built off of
the parsers in Hamlet. Once I'm back home, I can look into feasibility
a bit more, but I don't see any real barriers. We might need to export
a few extra things from the main Hamlet package, but that's doable.

Michael

Jasper Van der Jeugt

unread,
Aug 14, 2011, 5:35:45 AM8/14/11
to Michael Snoyman, hak...@googlegroups.com, web-devel
Thanks Michael! However, I would suggest to postpone this a little, at
least until I figure out exactly what way I want to go with Hakyll
templates -- so no work is lost. I'll request the runtime support back
when I need it :-)

Cheers,
Jasper

masterq

unread,
Sep 26, 2011, 11:57:27 AM9/26/11
to hakyll
Hi.

On Aug 13, 11:52 pm, Jasper Van der Jeugt <m...@jaspervdj.be> wrote:
> I've been thinking of powering up the template system in Hakyll a bit
> lately. However, the current support forHamlettemplates makes this a
> hard task. I was even thinking of droppingHamletsupport entirely for
> two reasons:
>
> - the runtime bindings seem to be available no more in the latest
> release of hamlet, making Hakyll dependent on an olderHamletversion;
> - the mismatches between the two formats.
>
> Obviously, I don't want to break any sites, so I would like to hear if
> anyone is currently using this feature, and what their opinions are.

I don't use Hamlet with Hakyll.

But I have a problem.
Hakyll debian package is broken now.

https://buildd.debian.org/status/package.php?p=haskell-hakyll

The broken reason is...

(1) Package hakyll is depend on libghc-hamlet-dev (< 0.9).
(2) But libghc-hamlet-dev is 0.10.1 on Debian, and Debian only have
one version of libghc-hamlet-dev.

I hope either hakyll drops to depend on hamlet, or hakyll support
hamlet 0.10.1.

Best regards,
Kiwamu Okabe

Simon Michael

unread,
Sep 27, 2011, 10:24:23 AM9/27/11
to hak...@googlegroups.com
Another hamlet user here. I've switched to hamlet for most of my hakyll sites. I only have one template per site so
changing would not be a huge deal, I just went with hamlet for its familiarity & documentation. I'm not sure if I'm
using runtime hamlet. I do use hakyll preview (love it).

Jens Petersen

unread,
Sep 28, 2011, 9:38:43 PM9/28/11
to hak...@googlegroups.com
On Tuesday, 27 September 2011 00:57:27 UTC+9, masterq wrote:

(Nice to meet you at the HakkuDaikai in Tokyo.:) 

(1) Package hakyll is depend on libghc-hamlet-dev (< 0.9).
(2) But libghc-hamlet-dev is 0.10.1 on Debian, and Debian only have
one version of libghc-hamlet-dev.

FWIW we are facing the same problem for Fedora...
I'd like to have both yesod and hakyll packaged in Fedora
but can't right now unless we stick with an old yesod release
which is not an attractive option.

Jens

Jasper Van der Jeugt

unread,
Sep 29, 2011, 5:48:17 AM9/29/11
to hak...@googlegroups.com, Michael Snoyman
In that case, Michael,

would it be possible to add a hamlet-rt package when time allows you?

Cheers,
Jasper

Michael Snoyman

unread,
Oct 3, 2011, 3:18:19 AM10/3/11
to Jasper Van der Jeugt, hak...@googlegroups.com, yeso...@googlegroups.com
I likely won't have time in the immediate future unfortunately, but
I'll try to get to it when I have a chance. I've CCed the Yesod
mailing list, in case anyone over there would like to take a crack at
this.

Kiwamu Okabe

unread,
Oct 4, 2011, 4:53:20 AM10/4/11
to hak...@googlegroups.com, Jasper Van der Jeugt, yeso...@googlegroups.com
Hi.

On Mon, Oct 3, 2011 at 4:18 PM, Michael Snoyman <mic...@snoyman.com> wrote:
> I likely won't have time in the immediate future unfortunately, but
> I'll try to get to it when I have a chance. I've CCed the Yesod
> mailing list, in case anyone over there would like to take a crack at
> this.

I write the patch for runtime hamlet.

https://github.com/yesodweb/hamlet/pull/23

Hakyll's test is green with the patched hamlet-0.10.2.

$ pwd
/home/kiwamu/src/hakyll
$ patch -p1 < ~/hakyll-hamlet-rt.patch # attached this mail
patching file hakyll.cabal
patching file src/Hakyll/Web/Template/Read/Hamlet.hs
$ ghc-pkg list |grep hamlet
hamlet-0.10.1
hamlet-0.10.2
$ make test
--snip--
Properties Test Cases Total
Passed 2 67 69
Failed 0 0 0
Total 2 67 69

This way is acceptable by hamlet and hakyll?
Or should I split libraries between hamlet and hamlet-rt?

Best regards,
--
Kiwamu Okabe

hakyll-hamlet-rt.patch

Michael Snoyman

unread,
Oct 4, 2011, 3:38:48 PM10/4/11
to yeso...@googlegroups.com, hak...@googlegroups.com, Jasper Van der Jeugt

Thank you for addressing that. I've released this code as hamlet
0.10.3. Jasper, can you confirm that this will solve the issue at
hand?

Thanks,
Michael

Jasper Van der Jeugt

unread,
Oct 5, 2011, 6:02:01 AM10/5/11
to Michael Snoyman, yeso...@googlegroups.com, hak...@googlegroups.com
Yes, it has solved the issue. Thanks for doing this, Kiwamu and
Michael! I'm uploading Hakyll 3.2.0.9 to hackage which works with the
new hamlet.

Cheers,
Jasper

Reply all
Reply to author
Forward
0 new messages