【发布时间】:2018-02-21 10:27:18
【问题描述】:
我有一个 Pug 模板(将成为根 index.html),它应该只列出我的帖子的标题:
p first line of the page
ul
each post in site.posts
li= post.title
p last line of the page
在构建网站时,我进入index.html
<p>first line of the page</p>
<ul>
<li></li>
<li></li>
</ul>
<p>last line of the page</p>
我在这个网站上有两个帖子,两个 <li></li> 建议我迭代正确的变量(并且该变量是已知的)。
如何从数组site.posts 中获取这些元素的内容?
【问题讨论】:
标签: pug templating hexo pugjs