Run converters before running liquid on a file? #889

jyruzicka opened this Issue Mar 27, 2013 · 9 comments


None yet
6 participants

A relatively simple change - I figure this hasn't been done because of something I've missed, but I figured it wouldn't hurt to file an issue.

In convertible.rb, in the do_layout method (line 78 or so in 0.12.1):

  self.content = Liquid::Template.parse(self.content).render!(payload, info)
rescue => e
  puts "Liquid Exception: #{e.message} in #{}"
  e.backtrace.each do |backtrace|
    puts backtrace
  abort("Build Failed")


Is there any reason that liquid runs before converters do? I could see this being a problem, for example, if you have a haml file, and liquid spits out some html that doesn't conform to haml's whitespacing requirements.

Swapping the order of these (convert, then run liquid) would fix this problem (you always know that liquid will be run after your converter - you don't know what sort of converter will be run after you run liquid on the raw content). This would also allow you to put liquid tags into the html in your converter, and have them get run (which is the real reason I'm interested in switching them around).


parkr commented Mar 27, 2013

HAML isn't currently officially supported by Jekyll.

We will eventually switch them around:

  1. turn liquid statements into some special hash that no converter will process
  2. convert
  3. replace hashes with corresponding liquid statements
  4. parse liquid
  5. output

Is this waiting on some other feature, or is it open to enthusiastic individuals forking and trying it on their own branch?


mattr- commented Mar 27, 2013

I don't believe this is waiting on any other feature. Fork away!

  • 1 I think this is a great optional setting.

parkr commented May 23, 2013

I get worried about this, as it makes it more difficult for others to diagnose any problems you might be having if this happens first. Also {% ... %} and {{ ... }} aren't valid markdown, are they?

Not sure what the original rationale was, though, for this ordering.

This would for sure allow us to properly run SLIM or HAML before running liquid. It would solve indentation problems.


parkr commented May 23, 2013

Don't SLIM and HAML basically do exactly what Liquid does? Can you give me an example of how you write a HAML template for Jekyll?

Yep, you are right. It's actually a waste to convert the template twice.

Here is an example file:

I was already looking for a solution to replace the {% %} tags. That would
allow us to go for the = tag SLIM uses. However, more problems are coming,
like how would you do a for loop etc? Anyone has a solution?

On Fri, May 24, 2013 at 1:48 AM, Parker Moore notifications@github.comwrote:

Don't SLIM and HAML basically do exactly what Liquid does? Can you give me
an example of how you write a HAML template for Jekyll?

Reply to this email directly or view it on GitHub


penibelst commented May 12, 2014

@jekyll/owners: can be closed.

@parkr parkr closed this Jul 31, 2014

@jekyllbot jekyllbot locked and limited conversation to collaborators Feb 27, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.