mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-12 22:17:06 +08:00
feat: 增加導覽欄顯示文章標題的選項 feat: 文章頁增加'返回首頁'文字 improvement: 當 per_page 為 0 時,頁面不顯示導覽列
This commit is contained in:
@@ -32,6 +32,7 @@ post:
|
|||||||
copyright_content: 'All articles on this blog are licensed under <a href="%s">%s</a> unless otherwise stated.'
|
copyright_content: 'All articles on this blog are licensed under <a href="%s">%s</a> unless otherwise stated.'
|
||||||
recommend: Related Articles
|
recommend: Related Articles
|
||||||
edit: Edit
|
edit: Edit
|
||||||
|
back_to_home: Back to Home
|
||||||
|
|
||||||
search:
|
search:
|
||||||
title: Search
|
title: Search
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ post:
|
|||||||
copyright_content: 'All articles on this blog are licensed under <a href="%s">%s</a> unless otherwise stated.'
|
copyright_content: 'All articles on this blog are licensed under <a href="%s">%s</a> unless otherwise stated.'
|
||||||
recommend: Related Articles
|
recommend: Related Articles
|
||||||
edit: Edit
|
edit: Edit
|
||||||
|
back_to_home: Back to Home
|
||||||
|
|
||||||
search:
|
search:
|
||||||
title: Search
|
title: Search
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ post:
|
|||||||
copyright_content: 'このブログのすべての記事は、<a href="%s">%s</a> ライセンスの下で提供されており、特に明記されていない限り、すべての権利を留保します。転載時には出典を明記してください: <a href="%s">%s</a>。'
|
copyright_content: 'このブログのすべての記事は、<a href="%s">%s</a> ライセンスの下で提供されており、特に明記されていない限り、すべての権利を留保します。転載時には出典を明記してください: <a href="%s">%s</a>。'
|
||||||
recommend: 関連記事
|
recommend: 関連記事
|
||||||
edit: 編集
|
edit: 編集
|
||||||
|
back_to_home: ホームに戻る
|
||||||
|
|
||||||
search:
|
search:
|
||||||
title: 検索
|
title: 検索
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ post:
|
|||||||
copyright_content: '이 블로그의 모든 글은 <a href="%s">%s</a> 라이선스를 따르며, 별도로 명시되지 않는 한 모든 권리를 보유합니다. 재배포 시 출처를 명시해 주세요: <a href="%s">%s</a>.'
|
copyright_content: '이 블로그의 모든 글은 <a href="%s">%s</a> 라이선스를 따르며, 별도로 명시되지 않는 한 모든 권리를 보유합니다. 재배포 시 출처를 명시해 주세요: <a href="%s">%s</a>.'
|
||||||
recommend: 관련 글
|
recommend: 관련 글
|
||||||
edit: 편집
|
edit: 편집
|
||||||
|
back_to_home: 홈으로 돌아가기
|
||||||
|
|
||||||
search:
|
search:
|
||||||
title: 검색
|
title: 검색
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ post:
|
|||||||
<a href="%s" target="_blank">%s</a> 许可协议。转载请注明来源 <a href="%s" target="_blank">%s</a>!'
|
<a href="%s" target="_blank">%s</a> 许可协议。转载请注明来源 <a href="%s" target="_blank">%s</a>!'
|
||||||
recommend: 相关推荐
|
recommend: 相关推荐
|
||||||
edit: 编辑
|
edit: 编辑
|
||||||
|
back_to_home: 返回首页
|
||||||
|
|
||||||
search:
|
search:
|
||||||
title: 搜索
|
title: 搜索
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ post:
|
|||||||
copyright_content: '除特別聲明外,本博客所有文章均採用<a href="%s">%s</a> 授權協議。轉載請註明出處:<a href="%s">%s</a>。'
|
copyright_content: '除特別聲明外,本博客所有文章均採用<a href="%s">%s</a> 授權協議。轉載請註明出處:<a href="%s">%s</a>。'
|
||||||
recommend: 相關文章
|
recommend: 相關文章
|
||||||
edit: 編輯
|
edit: 編輯
|
||||||
|
back_to_home: 返回首頁
|
||||||
|
|
||||||
search:
|
search:
|
||||||
title: 搜尋
|
title: 搜尋
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ post:
|
|||||||
copyright_content: '本部落格所有文章除特別聲明外,均採用<a href="%s" target="_blank">%s</a> 授權協議。轉載請註明來源 <a href="%s" target="_blank">%s</a>!'
|
copyright_content: '本部落格所有文章除特別聲明外,均採用<a href="%s" target="_blank">%s</a> 授權協議。轉載請註明來源 <a href="%s" target="_blank">%s</a>!'
|
||||||
recommend: 相關推薦
|
recommend: 相關推薦
|
||||||
edit: 編輯
|
edit: 編輯
|
||||||
|
back_to_home: 返回首頁
|
||||||
|
|
||||||
search:
|
search:
|
||||||
title: 搜尋
|
title: 搜尋
|
||||||
|
|||||||
@@ -56,6 +56,6 @@ div
|
|||||||
|
|
||||||
!= partial('includes/third-party/search/index', {}, { cache: true })
|
!= partial('includes/third-party/search/index', {}, { cache: true })
|
||||||
|
|
||||||
if (theme.google_tag_manager && theme.google_tag_manager.tag_id)
|
if theme.google_tag_manager && theme.google_tag_manager.tag_id
|
||||||
noscript
|
noscript
|
||||||
iframe(src=`${theme.google_tag_manager.domain ? theme.google_tag_manager.domain : 'https://www.googletagmanager.com'}/ns.html?id=${theme.google_tag_manager.tag_id}` height="0" width="0" style="display:none;visibility:hidden")
|
iframe(src=`${theme.google_tag_manager.domain ? theme.google_tag_manager.domain : 'https://www.googletagmanager.com'}/ns.html?id=${theme.google_tag_manager.tag_id}` height="0" width="0" style="display:none;visibility:hidden")
|
||||||
@@ -41,5 +41,5 @@ if (theme.google_tag_manager && theme.google_tag_manager.tag_id)
|
|||||||
"!{theme.google_tag_manager.domain ? theme.google_tag_manager.domain : 'https://www.googletagmanager.com'}/gtm.js?id="+i+dl;f.parentNode.insertBefore(j,f);
|
"!{theme.google_tag_manager.domain ? theme.google_tag_manager.domain : 'https://www.googletagmanager.com'}/gtm.js?id="+i+dl;f.parentNode.insertBefore(j,f);
|
||||||
})(window,document,'script','dataLayer','!{theme.google_tag_manager.tag_id}');
|
})(window,document,'script','dataLayer','!{theme.google_tag_manager.tag_id}');
|
||||||
btf.addGlobalFn('pjaxComplete', () => {
|
btf.addGlobalFn('pjaxComplete', () => {
|
||||||
dataLayer.push({'event': 'pjaxComplete', 'page_title': document.title, 'page_location': location.href, 'page_path': window.location.pathname});
|
dataLayer.push({'event': 'pjaxComplete', 'page_title': document.title, 'page_location': location.href, 'page_path': window.location.pathname})
|
||||||
}, 'google_tag_manager');
|
}, 'google_tag_manager')
|
||||||
@@ -5,9 +5,13 @@ nav#nav
|
|||||||
img.site-icon(src=url_for(theme.nav.logo) alt='Logo')
|
img.site-icon(src=url_for(theme.nav.logo) alt='Logo')
|
||||||
if theme.nav.display_title
|
if theme.nav.display_title
|
||||||
span.site-name=config.title
|
span.site-name=config.title
|
||||||
if globalPageType === 'post'
|
if globalPageType === 'post' && theme.nav.display_post_title
|
||||||
a.nav-page-title(href=url_for('/'))
|
a.nav-page-title(href=url_for('/'))
|
||||||
span.site-name=(page.title || config.title)
|
span.site-name=(page.title || config.title)
|
||||||
|
span.site-name
|
||||||
|
i.fa-solid.fa-circle-arrow-left
|
||||||
|
span= ' ' + _p('post.back_to_home')
|
||||||
|
|
||||||
#menus
|
#menus
|
||||||
if theme.search.use
|
if theme.search.use
|
||||||
#search-button
|
#search-button
|
||||||
|
|||||||
@@ -1,37 +1,38 @@
|
|||||||
-
|
if page.total !== 1
|
||||||
var options = {
|
-
|
||||||
prev_text: '<i class="fas fa-chevron-left fa-fw"></i>',
|
var options = {
|
||||||
next_text: '<i class="fas fa-chevron-right fa-fw"></i>',
|
prev_text: '<i class="fas fa-chevron-left fa-fw"></i>',
|
||||||
mid_size: 1,
|
next_text: '<i class="fas fa-chevron-right fa-fw"></i>',
|
||||||
escape: false
|
mid_size: 1,
|
||||||
}
|
escape: false
|
||||||
|
}
|
||||||
|
|
||||||
if globalPageType === 'post'
|
if globalPageType === 'post'
|
||||||
- let paginationOrder = theme.post_pagination === 2 ? { prev: page.prev, next: page.next } : { prev: page.next, next: page.prev }
|
- let paginationOrder = theme.post_pagination === 2 ? { prev: page.prev, next: page.next } : { prev: page.next, next: page.prev }
|
||||||
|
|
||||||
nav#pagination.pagination-post
|
nav#pagination.pagination-post
|
||||||
each direction, key in paginationOrder
|
each direction, key in paginationOrder
|
||||||
if direction
|
if direction
|
||||||
- const getPostDesc = direction.postDesc || postDesc(direction)
|
- const getPostDesc = direction.postDesc || postDesc(direction)
|
||||||
- let className = key === 'prev' ? (paginationOrder.next ? '' : 'full-width') : (paginationOrder.prev ? '' : 'full-width')
|
- let className = key === 'prev' ? (paginationOrder.next ? '' : 'full-width') : (paginationOrder.prev ? '' : 'full-width')
|
||||||
- className = getPostDesc ? className : className + ' no-desc'
|
- className = getPostDesc ? className : className + ' no-desc'
|
||||||
|
|
||||||
a.pagination-related(class=className href=url_for(direction.path) title=direction.title)
|
a.pagination-related(class=className href=url_for(direction.path) title=direction.title)
|
||||||
if direction.cover_type === 'img'
|
if direction.cover_type === 'img'
|
||||||
img.cover(src=url_for(direction.cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'` alt=`cover of ${key === 'prev' ? 'previous' : 'next'} post`)
|
img.cover(src=url_for(direction.cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'` alt=`cover of ${key === 'prev' ? 'previous' : 'next'} post`)
|
||||||
else
|
else
|
||||||
.cover(style=`background: ${direction.cover || 'var(--default-bg-color)'}`)
|
.cover(style=`background: ${direction.cover || 'var(--default-bg-color)'}`)
|
||||||
|
|
||||||
.info(class=key === 'prev' ? '' : 'text-right')
|
.info(class=key === 'prev' ? '' : 'text-right')
|
||||||
.info-1
|
.info-1
|
||||||
.info-item-1=_p(`pagination.${key}`)
|
.info-item-1=_p(`pagination.${key}`)
|
||||||
.info-item-2!=direction.title
|
.info-item-2!=direction.title
|
||||||
if getPostDesc
|
if getPostDesc
|
||||||
.info-2
|
.info-2
|
||||||
.info-item-1!=getPostDesc
|
.info-item-1!=getPostDesc
|
||||||
else
|
else
|
||||||
nav#pagination
|
nav#pagination
|
||||||
.pagination
|
.pagination
|
||||||
if globalPageType === 'home'
|
if globalPageType === 'home'
|
||||||
- options.format = 'page/%d/#content-inner'
|
- options.format = 'page/%d/#content-inner'
|
||||||
!=paginator(options)
|
!=paginator(options)
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hexo-theme-butterfly",
|
"name": "hexo-theme-butterfly",
|
||||||
"version": "5.4.0-b2",
|
"version": "5.4.0-b3",
|
||||||
"description": "A Simple and Card UI Design theme for Hexo",
|
"description": "A Simple and Card UI Design theme for Hexo",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ hexo.extend.filter.register('before_generate', () => {
|
|||||||
nav: {
|
nav: {
|
||||||
logo: null,
|
logo: null,
|
||||||
display_title: true,
|
display_title: true,
|
||||||
|
display_post_title: true,
|
||||||
fixed: false
|
fixed: false
|
||||||
},
|
},
|
||||||
menu: null,
|
menu: null,
|
||||||
|
|||||||
@@ -436,3 +436,28 @@
|
|||||||
&:hover
|
&:hover
|
||||||
&:after
|
&:after
|
||||||
width: 100%
|
width: 100%
|
||||||
|
|
||||||
|
.nav-page-title
|
||||||
|
position: relative
|
||||||
|
overflow: hidden
|
||||||
|
|
||||||
|
& > :first-child,
|
||||||
|
& > :last-child
|
||||||
|
display: inline-block
|
||||||
|
transition: all .3s ease-in-out
|
||||||
|
|
||||||
|
& > :last-child
|
||||||
|
position: absolute
|
||||||
|
top: 50%
|
||||||
|
left: 0
|
||||||
|
opacity: 0
|
||||||
|
transform: translateY(-50%) translateY(-10px)
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
& > :last-child
|
||||||
|
opacity: 1
|
||||||
|
transform: translateY(-50%) translateY(0)
|
||||||
|
|
||||||
|
& > :first-child
|
||||||
|
opacity: 0
|
||||||
|
transform: translateY(10px)
|
||||||
Reference in New Issue
Block a user