Refactor pagination tag.
完成分页标签的统一,现在可以这样写了:
首页:
<@paginationTag method="index" page="${posts.number}" total="${posts.totalPages}" display="3">
<div class="pagination">
<ul class="clearfix">
<#if pagination.hasPrev>
<li class="pre pagbuttons">
<a class="btn" role="navigation" href="${pagination.prevPageFullPath!}">上一页</a>
</li>
</#if>
<#if pagination.hasNext>
<li class="next pagbuttons">
<a class="btn" role="navigation" href="${pagination.nextPageFullPath!}">下一页</a>
</li>
</#if>
</ul>
</div>
</@paginationTag>
标签归档页:
<@paginationTag method="tagPosts" page="${posts.number}" total="${posts.totalPages}" display="3" slug="${tag.slug!}">
<div class="pagination">
<ul class="clearfix">
<#if pagination.hasPrev>
<li class="pre pagbuttons">
<a class="btn" role="navigation" href="${pagination.prevPageFullPath!}">上一页</a>
</li>
</#if>
<#if pagination.hasNext>
<li class="next pagbuttons">
<a class="btn" role="navigation" href="${pagination.nextPageFullPath!}">下一页</a>
</li>
</#if>
</ul>
</div>
</@paginationTag>
分类归档页:
<@paginationTag method="categoryPosts" page="${posts.number}" total="${posts.totalPages}" display="3" slug="${category.slug!}">
<div class="pagination">
<ul class="clearfix">
<#if pagination.hasPrev>
<li class="pre pagbuttons">
<a class="btn" role="navigation" href="${pagination.prevPageFullPath!}">上一页</a>
</li>
</#if>
<#if pagination.hasNext>
<li class="next pagbuttons">
<a class="btn" role="navigation" href="${pagination.nextPageFullPath!}">下一页</a>
</li>
</#if>
</ul>
</div>
</@paginationTag>
另外,修改了一个变量。prePost -> prevPost