hexo-theme-butterfly/layout/includes/pagination.pug
Jerry e2565a9f39 breaking changes: cover 的顯示優化 #1101
feature: default_cover 可配置顏色
fix: 修復使用本地搜索時,輸入特殊符號沒有顯示結果的 bug closed #1110
fix: 修復 頂部圖和 footer 配置帶有/的顏色參數時,無法顯示顏色的 bug
improvement: 鼠標移動到分頁時,文章分頁按鈕增加説明文字
improvement: 文章頁的頂部圖顯示次序為 top_img > cover > default_top_img
improvement: canonical 的鏈接根據配置生成 #1111
2022-12-13 01:23:50 +08:00

41 lines
1.6 KiB
Plaintext

-
var options = {
prev_text: '<i class="fas fa-chevron-left fa-fw"></i>',
next_text: '<i class="fas fa-chevron-right fa-fw"></i>',
mid_size: 1,
escape: false
}
if is_post()
- let prev = theme.post_pagination === 1 ? page.prev : page.next
- let next = theme.post_pagination === 1 ? page.next : page.prev
nav#pagination.pagination-post
if(prev)
- var hasPageNext = next ? 'pull-left' : 'pull-full'
.prev-post(class=hasPageNext)
a(href=url_for(prev.path) title=prev.title)
if prev.cover_type === 'img'
img.cover(src=url_for(prev.cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'` alt='cover of previous post')
else
.cover(style=`background: ${prev.cover || 'var(--default-bg-color)'}`)
.pagination-info
.label=_p('pagination.prev')
.prev_info=prev.title
if(next)
- var hasPagePrev = prev ? 'pull-right' : 'pull-full'
.next-post(class=hasPagePrev)
a(href=url_for(next.path) title=next.title)
if next.cover_type === 'img'
img.cover(src=url_for(next.cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'` alt='cover of next post')
else
.cover(style=`background: ${next.cover || 'var(--default-bg-color)'}`)
.pagination-info
.label=_p('pagination.next')
.next_info=next.title
else
nav#pagination
.pagination
if is_home()
- options.format = 'page/%d/#content-inner'
!=paginator(options)