Beerend Lauwers
2016-04-27 20:50:07 UTC
Hi all, I'd like to do the following: load a bunch of content with loadAll
and iterate over it in a for loop in a template. This part is trivial to do:
howDoIPosts <- loadAll "content/how-do-i/*/*"
let ctx = listField "how-do-i-posts" defaultContext (return howDoIPosts)
But now, I would like to add a new key to each element loaded by loadAll, a
calculated one: the value of the item's URL without its file extension,
which should be available in $url-plain$.
I've looked around in the source code, but it's not obvious to me how I
should go about this.
Does anyone have experience with this?
Kind Regards,
Beerend Lauwers
and iterate over it in a for loop in a template. This part is trivial to do:
howDoIPosts <- loadAll "content/how-do-i/*/*"
let ctx = listField "how-do-i-posts" defaultContext (return howDoIPosts)
But now, I would like to add a new key to each element loaded by loadAll, a
calculated one: the value of the item's URL without its file extension,
which should be available in $url-plain$.
I've looked around in the source code, but it's not obvious to me how I
should go about this.
Does anyone have experience with this?
Kind Regards,
Beerend Lauwers
--
You received this message because you are subscribed to the Google Groups "hakyll" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hakyll+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "hakyll" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hakyll+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.