You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hakyll recognizes content within the $...$ deliminators in templates as pandoc template syntax, and supports insertation of variables and usage of pandoc control structures within them.
But Pandoc has an alternative syntax that Hakyll does not seem to recognize: ${...}. I was a little surprised by this when first getting Hakyll set up.
[ERROR] _templates/post.html: Cannot parse template "_templates/post.html" (line 14, column 2):
unexpected "{"
expecting "-", "if(", "for(", "partial(", "\"" or letter
Could this syntax be supported? It is not at all an important request, but it would be nice for Hakyll to behave more similarly to Pandoc here.
The text was updated successfully, but these errors were encountered:
Yeah, Hakyll has its own implementation of templates, that's why there's a disparity in syntax. I think it'd be easy enough to fix: the Parsec parser for templates is defined in lib/Hakyll/Web/Template/Internal/Element.hs. Opening and closing dollar signs are parsed by trimOpen and trimClose. I think these will have to be replaced by some sort of a "bracketing" function, which should then be enhanced to support the curly-bracket syntax.
I checked Git and it seems that Pandoc added its templates a couple years before Hakyll did, so now I'm curious myself! @jaspervdj can answer authoritatively.
Recall that using pandoc with Hakyll is completely optional. You can compile pages using non-pandoc machinery.
Hence, templating must be implemented in Hakyll.
It could be nice to support the pandoc template syntax -- I am happy to review pull requests -- but Hakyll's internal template machinery is here to stay
Hakyll recognizes content within the
$...$
deliminators in templates as pandoc template syntax, and supports insertation of variables and usage of pandoc control structures within them.But Pandoc has an alternative syntax that Hakyll does not seem to recognize:
${...}
. I was a little surprised by this when first getting Hakyll set up.Could this syntax be supported? It is not at all an important request, but it would be nice for Hakyll to behave more similarly to Pandoc here.
The text was updated successfully, but these errors were encountered: