mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-10-04 06:22:00 +08:00
✨ feat: 本地搜索支持顯示文章內容和高亮keyword
🐛 fix: 修復搜索結果在手機端無法滾動的bug 🐛 fix: 修復aside categories 查看更多跳轉到tags頁面的bug closes #188
This commit is contained in:
1 parent
6c68ce1c4c
commit
e81a81c9d1
5 files changed
+69
-10
No files matched your search
@@ -18,7 +18,7 @@ hexo.extend.helper.register('aside_categories', function (categories, options) {
|
|||||||
const depth = options.depth ? parseInt(options.depth, 10) : 0
|
const depth = options.depth ? parseInt(options.depth, 10) : 0
|
||||||
const orderby = options.orderby || 'name'
|
const orderby = options.orderby || 'name'
|
||||||
const order = options.order || 1
|
const order = options.order || 1
|
||||||
const tagDir = this.url_for(config.tag_dir)
|
const categoryDir = this.url_for(config.category_dir)
|
||||||
const limit = options.limit === 0 ? categories.length : options.limit
|
const limit = options.limit === 0 ? categories.length : options.limit
|
||||||
const buttonLabel = this._p('aside.more_button')
|
const buttonLabel = this._p('aside.more_button')
|
||||||
const prepareQuery = parent => {
|
const prepareQuery = parent => {
|
||||||
@@ -74,7 +74,7 @@ hexo.extend.helper.register('aside_categories', function (categories, options) {
|
|||||||
var moreHtml = ''
|
var moreHtml = ''
|
||||||
if (categories.length <= limit) return ''
|
if (categories.length <= limit) return ''
|
||||||
moreHtml += '<li class="aside-category-list-item is-center">'
|
moreHtml += '<li class="aside-category-list-item is-center">'
|
||||||
moreHtml += `<a class="aside-category-list-item-more" href="${tagDir}" >`
|
moreHtml += `<a class="aside-category-list-item-more" href="${categoryDir}" >`
|
||||||
moreHtml += buttonLabel
|
moreHtml += buttonLabel
|
||||||
moreHtml += '</a></li>'
|
moreHtml += '</a></li>'
|
||||||
return moreHtml
|
return moreHtml
|
||||||
|
|||||||
@@ -50,4 +50,5 @@
|
|||||||
height: 100%
|
height: 100%
|
||||||
|
|
||||||
.search-result-list
|
.search-result-list
|
||||||
max-height: 100% !important
|
max-height: 75vh !important
|
||||||
|
padding-bottom: 2rem
|
||||||
@@ -18,7 +18,8 @@
|
|||||||
|
|
||||||
.local-search__hit-item
|
.local-search__hit-item
|
||||||
position: relative
|
position: relative
|
||||||
padding-left: 1.5rem
|
padding-left: 1.3rem
|
||||||
|
line-height: 1.7
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
&:before
|
&:before
|
||||||
@@ -27,7 +28,7 @@
|
|||||||
&:before
|
&:before
|
||||||
$w = .3rem
|
$w = .3rem
|
||||||
position: absolute
|
position: absolute
|
||||||
top: .4rem
|
top: .3rem
|
||||||
left: 0
|
left: 0
|
||||||
width: w = $w
|
width: w = $w
|
||||||
height: h = w
|
height: h = w
|
||||||
@@ -41,12 +42,20 @@
|
|||||||
a
|
a
|
||||||
display: block
|
display: block
|
||||||
color: $font-black
|
color: $font-black
|
||||||
|
font-weight: 600
|
||||||
font-size: 14px
|
font-size: 14px
|
||||||
cursor: pointer
|
cursor: pointer
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
color: $search-color
|
color: $search-color
|
||||||
|
|
||||||
|
.search-result
|
||||||
|
margin: 0 0 .4rem
|
||||||
|
|
||||||
|
.search-keyword
|
||||||
|
color: $search-keyword-highlight
|
||||||
|
font-weight: bold
|
||||||
|
|
||||||
.local-search-stats__hr
|
.local-search-stats__hr
|
||||||
display: none !important
|
display: none !important
|
||||||
|
|
||||||
|
|||||||
Loaded 3 of 5 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user