Re: Custom key delimiters for Hakyll templates?

43 views
Skip to first unread message

Mark Reid

unread,
Oct 17, 2012, 10:20:59 PM10/17/12
to hak...@googlegroups.com
On further inspection, it seems that the `$` delimiter is also hard-coded in Hakyll.Web.Template.hs.

Ian Ross

unread,
Oct 18, 2012, 6:09:42 AM10/18/12
to hak...@googlegroups.com
Hi Mark,

I'm surprised that this is a problem. The "$foo$" things appear only
in templates, which are normally bits of HTML, with "$foo$" things for
interpolation. The "$\phi$" notation for LaTeX appears in *posts*,
which are in Markdown (or .lhs, or whatever you set up). So there
shouldn't be a conflict, unless you're doing something in a different
way to the usual setup. Are you really trying to use LaTeX notation
within the templates? (I don't know how that might work.)

Take a look, for example, at
http://www.skybluetrades.net/posts/2012/01/04/simplex-algorithm-warm-up/index.html
-- this has LaTeX markup within the Markdown page, and is rendered
correctly as MathML in the resulting HTML pages.

Or have I completely failed to understand what's going on?

Cheers,

Ian.

On 18 October 2012 04:20, Mark Reid <mark...@gmail.com> wrote:
> On further inspection, it seems that the `$` delimiter is also hard-coded in
> Hakyll.Web.Template.hs.



--
Ian Ross Tel: +43(0)6804451378 i...@skybluetrades.net www.skybluetrades.net

Mark Reid

unread,
Oct 18, 2012, 7:22:22 PM10/18/12
to hak...@googlegroups.com
Hi Ian,

Thanks for your response. 

Upon reflection, I think the main contributing factors to the problem I'm having is that I have been quite sloppy with separation of templates and content. In particular, I have one page in my Jekyll set up that is mostly text but whose markdown includes template code to pull in a list of recent posts. The way Jekyll renders pages means that this works quite well. 

I guess I assumed I could do something similar with Hakyll, but I may have to reconsider how I organise things. When I first started messing around with page compilers I think I constructed one that did applyTemplate ... >>> pageRenderPandocWith ... instead of pageRenderPandocWith ... >>> applyTemplate ... .

Regards,

Mark
---

Ian Ross

unread,
Oct 19, 2012, 5:18:44 AM10/19/12
to hak...@googlegroups.com
Jasper might have something more authoritative to say about it too,
but I think what you probably need to do is pull the Markdown out of
that page template into a separate file, render it as a page without a
route (so it doesn't end up being a separate bit of HTML in the output
site), and replace the Markdown in your template with a $foo$
reference that you then fake up to contain the rendered Markdown
(either using some combination of oe of the "require" functions and
one of the "setField" functions, or using setFieldPage). It's
definitely possible, it just may take a little bit of playing around
to decide exactly what the cleanest way of doing it is.

Jasper Van der Jeugt

unread,
Oct 19, 2012, 11:03:02 AM10/19/12
to hak...@googlegroups.com
I think Ian is right in this case---it's always a good idea to
separate the actual content from the HTML template. If you create a
templates/index.html and index.tex file for your page, the process
becomes fairly straightforward: you just compile the TeX file and
apply the index template (possibly followed by other templates).

Hope this helps,
Peace,
Jasper
Reply all
Reply to author
Forward
0 new messages