def layout_for_template(template, options)
      layout_name = if template.data.key?(:layout)
                      template.data[:layout]
                    else
                      get_default_layout(template, options)
                    end

      # Only attempt to load layout when:
      # - Template is the toplevel template
      # - A layout_name is available
      return BlankTemplate.new if current_template || !layout_name

      template(layout_name, nil, :layout)
    end
def layout_for_template(template, options)
      layout_name = if template.data.key?(:layout)
                      template.data[:layout]
                    else
                      get_default_layout(template, options)
                    end

      # Only attempt to load layout when:
      # - Template is the toplevel template
      # - A layout_name is available
      return BlankTemplate.new if current_template || !layout_name

      template(layout_name, nil, :layout)
    end
Gets the layout for a specific template