feat: aside ‘查看更多’按鈕 改為 圖標顯示在右上角

improvement: pangu 改為全站渲染
This commit is contained in:
Jerry
2021-01-10 22:26:18 +08:00
parent 0eac648267
commit a1f86a1573
7 changed files with 35 additions and 35 deletions

View File

@@ -25,7 +25,6 @@ hexo.extend.helper.register('aside_categories', function (categories, options) {
const limit = options.limit === 0 ? categories.length : options.limit
const isExpand = options.expand !== 'none'
const expandClass = isExpand && options.expand === true ? 'expand' : ''
const buttonLabel = this._p('aside.more_button')
const prepareQuery = (parent) => {
const query = {}
@@ -80,17 +79,19 @@ hexo.extend.helper.register('aside_categories', function (categories, options) {
const list = hierarchicalList(limit, 0)
const moreButton = function () {
let moreHtml = ''
if (categories.length <= limit) return ''
moreHtml += '<li class="card-category-list-item more is-center">'
moreHtml += `<a class="card-category-list-link-more" href="${categoryDir}/">
<span>${buttonLabel}</span><i class="fas fa-angle-right"></i></a></li>`
const moreHtml = `<a class="card-more-btn" href="${categoryDir}/" title="${buttonLabel}">
<i class="fas fa-angle-right"></i></a>`
return moreHtml
}
return `<ul class="card-category-list" id="aside-cat-list">
${list[0]}
return `<div class="item-headline">
<i class="fas fa-folder-open"></i>
<span>${this._p('aside.card_categories')}</span>
${moreButton()}
</div>
<ul class="card-category-list" id="aside-cat-list">
${list[0]}
</ul>`
})