瀏覽代碼

Render locals in layout as well as template

tags/v0.4.0
Adrian Short 5 年之前
父節點
當前提交
c9c314e74b
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. +1
    -1
      lib/petrify.rb

+ 1
- 1
lib/petrify.rb 查看文件

@@ -18,7 +18,7 @@ module Petrify
fn = File.join(dir, 'index.html')
# https://stackoverflow.com/questions/6125265/using-layouts-in-haml-files-independently-of-rails
html = Haml::Engine.new(File.read(@@layout_fn)).render do
html = Haml::Engine.new(File.read(@@layout_fn)).render(Object.new, locals) do
Haml::Engine.new(File.read(File.join(@@views_dir, "#{template}.haml"))).render(Object.new, locals)
end



Loading…
取消
儲存