Using alternative templating with Middleman

时间:2016-04-04 17:27:19

标签: templates liquid middleman static-site tilt

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 个答案:

答案 0 :(得分:0)

您需要在Gemfile中安装液体宝石,例如 gem 'liquid', '~> 3.0.0', :require => false

然后在config.rb中您可以使用设置液体引擎 set :liquid, :layout_engine => :liquid

然后,如果您将.liquid扩展名添加到名称,则为您的文件,例如index.html.liquid,它们将通过液体处理器运行。

签出此项目作为示例https://github.com/Palmaswell/liquid-bourbon-middleman