Hexo.js では、いくつかの記事を出力する場合.sort、 、 、.limitおよびを使用してループします.each。たとえば、次のようになります。
<% site.posts.sort('date', 'desc').limit(8).each(function(post){ %>
<div id="post-1" class="post">
<%= post.title %>
all the other post tags and content
</div>
<% }) %>
ID 番号を動的にインクリメントするように設定するにはどうすればよいですか。post-Xたとえば、最初の投稿はid="post-1"、2 番目id="post-2"などになりますか?