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

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.

主站蜘蛛池模板: 泰兴市| 诏安县| 盐山县| 壤塘县| 宝兴县| 墨脱县| 蛟河市| 墨竹工卡县| 社会| 西平县| 隆化县| 晋州市| 盘山县| 上蔡县| 铅山县| 宜兴市| 互助| 蒙山县| 兖州市| 蒲江县| 阿克| 新巴尔虎左旗| 楚雄市| 新疆| 文成县| 通榆县| 菏泽市| 灵石县| 青田县| 罗定市| 云和县| 嵊州市| 阳朔县| 遂溪县| 郸城县| 梅河口市| 垣曲县| 静海县| 睢宁县| 波密县| 黄陵县|