How to structure a layout template in Haml

前端 未结 2 1680
小蘑菇
小蘑菇 2021-01-31 11:29

I have a web page that uses Haml for layouts. \"layout.haml\" is a separate layout file which is used when rendering any actual Haml page.

layout.haml looks something l

2条回答
  •  迷失自我
    2021-01-31 12:23

    I use partials:

    !!!
    %html
      = partial('trst_sys/shared/html-head')
    
      %body{:id => "srv",:'data-lang' => current_lang}
      #main.wrap
        %header#header
          = partial('trst_sys/shared/header')
        %nav#menu
          = partial('trst_sys/shared/menu')
        %section#content
          %article#xhr_content
            = yield
          %article#xhr_msg.hidden
        %section#sidebar
          = partial('trst_sys/shared/sidebar')
        %section#main_footer.wrap
      %footer#footer.wrap
        = partial('trst_sys/shared/footer')
    

提交回复
热议问题