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

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.

主站蜘蛛池模板: 新乡市| 平武县| 平度市| 高密市| 山东省| 扶绥县| 同仁县| 叶城县| 乐亭县| 菏泽市| 田东县| 壤塘县| 宁蒗| 宜宾县| 忻城县| 扎鲁特旗| 阜新市| 维西| 禄丰县| 磴口县| 祁东县| 收藏| 大埔区| 扎赉特旗| 广宁县| 淮北市| 清镇市| 米泉市| 宣武区| 长乐市| 泸西县| 苏尼特右旗| 梧州市| 阿坝| 万州区| 张掖市| 吴旗县| 新乐市| 桃园市| 涞水县| 咸丰县|