官术网_书友最值得收藏!

Adding templates and partials

To show the home template in the app, we need to open index.html, which we created earlier, and perform the following steps:

  1. We replace Hello World with the following template inclusion helper:
    {{> layout}}
  2. If we go back to our browser now, we see that the text is gone and the layout template, which we created earlier, has appeared with its header and menu.
  3. To complete the page, we need to show the home template in the layout template. We do this by simply adding another template inclusion helper to the main section of the layout template in our layout.html file, as follows:
    <main>
      {{> home}}
    </main>
  4. If we go back to the browser, we should see the following screenshot:
    Adding templates and partials

If we would now switch {{> home}} for {{> about}}, we would see our about template instead.

主站蜘蛛池模板: 轮台县| 桑植县| 峨边| 商水县| 余干县| 麻城市| 渝中区| 临潭县| 新竹市| 赫章县| 南木林县| 雅江县| 永善县| 西畴县| 吉首市| 泰顺县| 曲沃县| 泉州市| 泗阳县| 静乐县| 水城县| 鲁山县| 宁蒗| 平顶山市| 潼关县| 和龙市| 宕昌县| 庆安县| 宽甸| 石门县| 曲靖市| 房山区| 灵山县| 垫江县| 河北省| 德安县| 昌宁县| 梁河县| 平罗县| 民丰县| 达尔|