r***@gmail.com
2016-09-02 01:51:16 UTC
Hi,
I'm trying to add a boolean "featured" field to my metadata. In the
template, I'd like to filter items based on whether or not they are
featured.
$if(featured)$
$partial("...")$
$endif$
I know that this only checks existence, so at the moment my solution is
simply leaving the field out of non-featured items. However, I was
wondering if there was a way to use something like `boolField` on metadata
so I could do something like:
featured: yes
- or -
featured: no
and have it display based on that.
Since `boolField` only accepts `Item a -> Bool`, and as far as I can
figure, Metadata can only be retrieved while wrapped in the MonadMetadata
monad, I've no idea if this is possible. The best I've managed is `Item a
-> m Bool`, which isn't particularly useful for anything.
Is there some way to do this that I'm missing, or is this sort of behavior
just not supported?
Thanks,
Rob
I'm trying to add a boolean "featured" field to my metadata. In the
template, I'd like to filter items based on whether or not they are
featured.
$if(featured)$
$partial("...")$
$endif$
I know that this only checks existence, so at the moment my solution is
simply leaving the field out of non-featured items. However, I was
wondering if there was a way to use something like `boolField` on metadata
so I could do something like:
featured: yes
- or -
featured: no
and have it display based on that.
Since `boolField` only accepts `Item a -> Bool`, and as far as I can
figure, Metadata can only be retrieved while wrapped in the MonadMetadata
monad, I've no idea if this is possible. The best I've managed is `Item a
-> m Bool`, which isn't particularly useful for anything.
Is there some way to do this that I'm missing, or is this sort of behavior
just not supported?
Thanks,
Rob
--
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.