Discussion:
[hakyll] Some questions around context
p***@spootnik.org
2015-08-04 11:11:33 UTC
Permalink
Hi,

I'm beginning my transition from o-blog to hakyll and finding it very
satisfying so far, thanks for the great work.
I have a bit of trouble with a couple of use-cases and I would love your
input on it:

1. I would like to be able to supply arbitrary lists in my Context, a bit
like constField but for
a list. This would allow me to configure what my navigation area
contains, based on
the route. I can't see how to do it. I basically want something of this
essence:

mapListField :: String -> [(String, String)] -> Context a

It seems it should leverage listField, but since I'm not dealing with
items
How to go about it escapes me.

2. It seems as though the metadata from org-mode documents is not looked up
by hakyll. I am not speaking about YAML front-matter, but indications
such
as "#+title: Some title" which are valid in the Org-mode world. Is only
front-matter processed ? If so, how should I go about accessing the
pandoc document to pull its metadata ?

3. Is there a generic way of rewriting URLs ? My posts are stored as
YYYY-mm-dd-post-title.org, my previous URL nomenclature was
entries/YYYY/mm/dd/post-title.html, is it possible to access
item metadata during URL rewrites ?

Sorry for the - most likely - beginner questions, I'm still wrapping my
head around some parts of hakyll and haskell.

Cheers,
- pyr
--
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.
Kyle Marek-Spartz
2015-08-04 21:19:25 UTC
Permalink
I can't help with everything, but there was just this post to the
mailing list which should help with routing:

https://groups.google.com/forum/#!topic/hakyll/ymwiCNn0w0w
Post by p***@spootnik.org
Hi,
I'm beginning my transition from o-blog to hakyll and finding it very
satisfying so far, thanks for the great work.
I have a bit of trouble with a couple of use-cases and I would love your
1. I would like to be able to supply arbitrary lists in my Context, a bit
like constField but for
a list. This would allow me to configure what my navigation area
contains, based on
the route. I can't see how to do it. I basically want something of this
mapListField :: String -> [(String, String)] -> Context a
It seems it should leverage listField, but since I'm not dealing with
items
How to go about it escapes me.
2. It seems as though the metadata from org-mode documents is not looked up
by hakyll. I am not speaking about YAML front-matter, but indications
such
as "#+title: Some title" which are valid in the Org-mode world. Is only
front-matter processed ? If so, how should I go about accessing the
pandoc document to pull its metadata ?
3. Is there a generic way of rewriting URLs ? My posts are stored as
YYYY-mm-dd-post-title.org, my previous URL nomenclature was
entries/YYYY/mm/dd/post-title.html, is it possible to access
item metadata during URL rewrites ?
Sorry for the - most likely - beginner questions, I'm still wrapping my
head around some parts of hakyll and haskell.
Cheers,
- pyr
--
Kyle Marek-Spartz
--
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.
p***@spootnik.org
2015-08-05 09:32:14 UTC
Permalink
Thanks Kyle,

I had stumbled upon it later on also. Sorry for asking the same question
twice.

Cheers,
- pyr
Post by Kyle Marek-Spartz
I can't help with everything, but there was just this post to the
https://groups.google.com/forum/#!topic/hakyll/ymwiCNn0w0w
Post by p***@spootnik.org
Hi,
I'm beginning my transition from o-blog to hakyll and finding it very
satisfying so far, thanks for the great work.
I have a bit of trouble with a couple of use-cases and I would love your
1. I would like to be able to supply arbitrary lists in my Context, a
bit
Post by p***@spootnik.org
like constField but for
a list. This would allow me to configure what my navigation area
contains, based on
the route. I can't see how to do it. I basically want something of
this
Post by p***@spootnik.org
mapListField :: String -> [(String, String)] -> Context a
It seems it should leverage listField, but since I'm not dealing with
items
How to go about it escapes me.
2. It seems as though the metadata from org-mode documents is not looked
up
Post by p***@spootnik.org
by hakyll. I am not speaking about YAML front-matter, but indications
such
as "#+title: Some title" which are valid in the Org-mode world. Is
only
Post by p***@spootnik.org
front-matter processed ? If so, how should I go about accessing the
pandoc document to pull its metadata ?
3. Is there a generic way of rewriting URLs ? My posts are stored as
YYYY-mm-dd-post-title.org, my previous URL nomenclature was
entries/YYYY/mm/dd/post-title.html, is it possible to access
item metadata during URL rewrites ?
Sorry for the - most likely - beginner questions, I'm still wrapping my
head around some parts of hakyll and haskell.
Cheers,
- pyr
--
Kyle Marek-Spartz
--
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.
Kyle Marek-Spartz
2015-08-05 14:07:13 UTC
Permalink
Oh, no problem!
Post by p***@spootnik.org
Thanks Kyle,
I had stumbled upon it later on also. Sorry for asking the same question
twice.
Cheers,
- pyr
Post by Kyle Marek-Spartz
I can't help with everything, but there was just this post to the
https://groups.google.com/forum/#!topic/hakyll/ymwiCNn0w0w
Post by p***@spootnik.org
Hi,
I'm beginning my transition from o-blog to hakyll and finding it very
satisfying so far, thanks for the great work.
I have a bit of trouble with a couple of use-cases and I would love your
1. I would like to be able to supply arbitrary lists in my Context, a
bit
Post by p***@spootnik.org
like constField but for
a list. This would allow me to configure what my navigation area
contains, based on
the route. I can't see how to do it. I basically want something of
this
Post by p***@spootnik.org
mapListField :: String -> [(String, String)] -> Context a
It seems it should leverage listField, but since I'm not dealing with
items
How to go about it escapes me.
2. It seems as though the metadata from org-mode documents is not looked
up
Post by p***@spootnik.org
by hakyll. I am not speaking about YAML front-matter, but indications
such
as "#+title: Some title" which are valid in the Org-mode world. Is
only
Post by p***@spootnik.org
front-matter processed ? If so, how should I go about accessing the
pandoc document to pull its metadata ?
3. Is there a generic way of rewriting URLs ? My posts are stored as
YYYY-mm-dd-post-title.org, my previous URL nomenclature was
entries/YYYY/mm/dd/post-title.html, is it possible to access
item metadata during URL rewrites ?
Sorry for the - most likely - beginner questions, I'm still wrapping my
head around some parts of hakyll and haskell.
Cheers,
- pyr
--
Kyle Marek-Spartz
--
Kyle Marek-Spartz
--
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.
b***@gmail.com
2015-08-26 07:06:57 UTC
Permalink
Hi pyr,

You might be interested in my spelunking in Hakyll's field and listfield
functions: http://beerendlauwers.be/posts/2015-08-17-hacking-on-hakyll-pt-2.html

Kind Regards,
Beerend Lauwers
Post by p***@spootnik.org
Hi,
I'm beginning my transition from o-blog to hakyll and finding it very
satisfying so far, thanks for the great work.
I have a bit of trouble with a couple of use-cases and I would love your
1. I would like to be able to supply arbitrary lists in my Context, a bit
like constField but for
a list. This would allow me to configure what my navigation area
contains, based on
the route. I can't see how to do it. I basically want something of this
mapListField :: String -> [(String, String)] -> Context a
It seems it should leverage listField, but since I'm not dealing with
items
How to go about it escapes me.
2. It seems as though the metadata from org-mode documents is not looked up
by hakyll. I am not speaking about YAML front-matter, but indications
such
as "#+title: Some title" which are valid in the Org-mode world. Is only
front-matter processed ? If so, how should I go about accessing the
pandoc document to pull its metadata ?
3. Is there a generic way of rewriting URLs ? My posts are stored as
YYYY-mm-dd-post-title.org, my previous URL nomenclature was
entries/YYYY/mm/dd/post-title.html, is it possible to access
item metadata during URL rewrites ?
Sorry for the - most likely - beginner questions, I'm still wrapping my
head around some parts of hakyll and haskell.
Cheers,
- pyr
--
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.
Loading...