HomepageTemplate查找顺序
文章目录
首页模板是构建网站的唯一必须的模板, 和其他的列表型模板一样, 可以使用_index.md作为内容关联. _index.md存放在content目录下content/_index.md
首页模板的查找顺序
1 2 3 4 5 6 7 8 9 10 11 |
layouts/page/index.html //page为type的默认值 layouts/page/home.html layouts/page/list.html layouts/index.html layouts/home.html layouts/list.html layouts/_default/index.html layouts/_default/home.html layouts/_default/list.html |
设置了type属性的首页模板的查找顺序
1 2 3 4 5 6 7 8 9 10 11 |
layouts/type的值/index.html layouts/type的值/home.html layouts/type的值/list.html layouts/index.html layouts/home.html layouts/list.html layouts/_default/index.html layouts/_default/home.html layouts/_default/list.html |
如果要设置首页的type属性, 需要在content目录下面添加_index.md文件, 并设置FromtMatter中的type属性, 同时在layouts目录下面创建和type属性的值相同的目录名.
index, home, list这些模板文件名是固定的.
文章作者 Suroppo
上次更新 2019-11-03