循环输出 3 篇文章
for post in site.posts limit:3
endfor
循环输出最近 3 篇
for post in site.posts offset:3 limit:3
endfor
日期
page.date | date:"%B %b, %Y"
分页输出
for post in paginator.posts
content
endfor
分页
if paginator.previous_page
//判断输出前一个分页
//"page" + paginator.previous_page
endif
if paginator.next_page
//判断输出后一个分页
//"page" + paginator.next_page
endif
for page in (1..paginator.total_pages)
if page == paginator.page
//如果是当前分页
//page
else
//不是的话输出其他分页链接号码
//"page" + page
endif
endfor
文章页面显示前一篇文章和后一篇文章
if page.previous
//url: page.previous.url
//title: page.previous.title | truncatewords:5
endif
if page.next
//url: page.next.url
//title: page.next.url | truncatewords:5
本文由 liberxue 创作,采用 知识共享署名4.0 国际许可协议进行许可
本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名
最后编辑时间为:2017-06-17 00:00:00