Discussion:
[hakyll] Generating templates from Markdown
Govind Gopakumar
2017-01-28 19:20:46 UTC
Permalink
Hi,

Sorry if this seems like a trivial doubt.

I'm trying to generate HTML files from Markdown (a.md, b.md, c.md - >
a.html, b.html, c.html), and then insert a post list in each of these HTML.
I tried to edit the match "a.html" portion of the site.hs file, but
unfortunately, if I generate the html files correctly, I'm not able to
match them (as in, if I do match "a.md" and generate a html, I can't later
match "a.html" to add to its content).

How would I go about doing this? Ideally, I would like to edit a.md and
have it rendered (through pandocCompiler) and also add a list of posts
(a1.html, a2.html) to this final html.


Thanks you for the help!

Regards,

Govind
--
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.
E Kim
2017-01-29 04:10:40 UTC
Permalink
Hi,

In my opinion, to generate post list, you need to load from markdown files or snapshots.
I recommend to see `loadAll` and `loadAllSnapshots` function in Hakyll library.

See my code as an example.

https://github.com/eunchan/website.code/blob/master/src/Post.hs#L80

Regards,
E.Kim


On Jan 28, 2017, at 11:20 AM, Govind Gopakumar <***@gmail.com> wrote:

Hi,

Sorry if this seems like a trivial doubt.

I'm trying to generate HTML files from Markdown (a.md, b.md, c.md - > a.html, b.html, c.html), and then insert a post list in each of these HTML. I tried to edit the match "a.html" portion of the site.hs file, but unfortunately, if I generate the html files correctly, I'm not able to match them (as in, if I do match "a.md" and generate a html, I can't later match "a.html" to add to its content).

How would I go about doing this? Ideally, I would like to edit a.md and have it rendered (through pandocCompiler) and also add a list of posts (a1.html, a2.html) to this final html.


Thanks you for the help!

Regards,

Govind

--
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.
Loading...