mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2025-09-15 12:58:48 +08:00
feature: default_cover 可配置顏色 fix: 修復使用本地搜索時,輸入特殊符號沒有顯示結果的 bug closed #1110 fix: 修復 頂部圖和 footer 配置帶有/的顏色參數時,無法顯示顏色的 bug improvement: 鼠標移動到分頁時,文章分頁按鈕增加説明文字 improvement: 文章頁的頂部圖顯示次序為 top_img > cover > default_top_img improvement: canonical 的鏈接根據配置生成 #1111
23 lines
1.1 KiB
Plaintext
23 lines
1.1 KiB
Plaintext
mixin articleSort(posts)
|
|
.article-sort
|
|
- var year
|
|
- posts.each(function (article) {
|
|
- let tempYear = date(article.date, 'YYYY')
|
|
- let no_cover = article.cover === false || !theme.cover.archives_enable ? 'no-article-cover' : ''
|
|
- let title = article.title || _p('no_title')
|
|
if tempYear !== year
|
|
- year = tempYear
|
|
.article-sort-item.year= year
|
|
.article-sort-item(class=no_cover)
|
|
if article.cover && theme.cover.archives_enable
|
|
a.article-sort-item-img(href=url_for(article.path) title=title)
|
|
if article.cover_type === 'img'
|
|
img(src=url_for(article.cover) alt=title onerror=`this.onerror=null;this.src='${url_for(theme.error_img.post_page)}'`)
|
|
else
|
|
div(style=`background: ${article.cover}`)
|
|
.article-sort-item-info
|
|
.article-sort-item-time
|
|
i.far.fa-calendar-alt
|
|
time.post-meta-date-created(datetime=date_xml(article.date) title=_p('post.created') + ' ' + full_date(article.date))= date(article.date, config.date_format)
|
|
a.article-sort-item-title(href=url_for(article.path) title=title)= title
|
|
- }) |