<sectionid="posts"class="posts-expand"> {% for post in posts %} {% assign is_index = true %} {% include _macro/post.html %} {% endfor %} </section>
{% include _partials/pagination.html %}
这下就难了,这些类似于模板标记的代码是Jekyll使用的Liquid语法,而我只会JS。根据以往的经验这一行 for post in posts 应该就是for循环了。其中的posts变量应该就是所有博文的集合了。posts的初始值是site.posts。当site.paginate大于0时,则posts安照分页大小来确定。但是我不会写Liquid语法。最后我决定用Liquid语法和JS混合开发。
# When running the site in a subdirectory (e.g. domain.tld/blog), remove the leading slash (/archives -> archives) menu: home:/ archives:/archives/ random:/random/#新的随机菜单 categories:/categories/ tags:/tags/ about:/about/ # Enable/Disable menu icons. # Icon Mapping: # Map a menu item to a specific FontAwesome icon name. # Key is the name of menu item and value is the name of FontAwesome icon. Key is case-senstive. # When an question mask icon presenting up means that the item has no mapping icon. menu_icons: enable:true #KeyMapsToMenuItemKey: NameOfTheIconFromFontAwesome home:home archives:archive random:random#新的随机菜单的图标 categories:th tags:tags about:user