使用Pug迭代Jekyll的帖子
问题描述:
我是新来使用帕格,我想要完成的基本上是将其转换为帕格代码。使用Pug迭代Jekyll的帖子
<div id="home">
<h1>Blog Posts</h1>
<ul class="posts">
{% for post in site.posts %}
<li><span>{{ post.date | date_to_string }}</span> » <a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
</div>
这是我的代码,但在编译时不断收到错误。
#home
h1 Blog Posts
- var _posts = [_site.posts]
ul.blog
each post in _posts
li
span
a(href={post.date | date_to_string})
» a(href={{ post.url }}>{{ post.title }})
答
我有同样的职业,而且我通过inseting纯文本喜欢这些
.posts-wrap
ul
|{% for post in site.posts %}
| <li>
| hi,there
| </li>
|{% endfor %}
生病后尝试这种解决它。谢谢(你的)信息。 – juscuizon