1

I would like to use Liquid templates with Middleman rather than the default ERb.

I know I need to go into config.rb and require it but i'm not sure of the exact syntax I need to use in config.rb to achieve this. I am also unsure of whether I need to just download Liquid from the Liquid website or whether I need to download tilt for this to work?

1 Answer 1

0

You would need to install the liquid gem in your Gemfile e.g. gem 'liquid', '~> 3.0.0', :require => false.

Then in the config.rb you can set the liquid engine using set :liquid, :layout_engine => :liquid

Then for your files if you add the .liquid extension to the name e.g. index.html.liquid, they will be run through the liquid processor.

Checkout this project as an example https://github.com/Palmaswell/liquid-bourbon-middleman

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.