mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 17:50:54 +08:00
✨ feat: aside widget 增加部分參數可配置
✨ feat: aside widget的Categories,Tags,post,Archives可配置limit ✨ feat: 整合公告欄配置到aside去 🐛 fix: 修復當flink.yml內容為空時,報錯的bug 💄 fix: 修復darkmode下 aside 查看更多文字顏色太淺的bug
This commit is contained in:
@@ -3,4 +3,4 @@
|
||||
.item-headline
|
||||
i.fa.fa-bullhorn.card-announcement-animation(aria-hidden="true")
|
||||
span= _p('aside.card_announcement')
|
||||
.announcement_content!= theme.announcement.content
|
||||
.announcement_content!= theme.aside.card_announcement.content
|
||||
@@ -3,4 +3,9 @@
|
||||
.item-headline
|
||||
i.fa.fa-archive(aria-hidden="true")
|
||||
span= _p('aside.card_archives')
|
||||
!= list_archives({type:'monthly',format: 'YYYY年MM月'})
|
||||
|
||||
- let type = theme.aside.card_archives.type || 'monthly'
|
||||
- let format = theme.aside.card_archives.format || 'MMMM YYYY'
|
||||
- let order = theme.aside.card_archives.order || -1
|
||||
- let limit = theme.aside.card_archives.limit === 0 ? 0 : theme.aside.card_archives.limit || 8
|
||||
!= aside_archives({ type:type, format: format, order: order, limit: limit })
|
||||
|
||||
@@ -4,20 +4,6 @@ if site.categories.length
|
||||
.item-headline
|
||||
i.fa.fa-folder-open(aria-hidden="true")
|
||||
span= _p('aside.card_categories')
|
||||
ul.aside-category-item
|
||||
mixin displayCategories(parent = undefined)
|
||||
- site.categories.find({ parent }).sort("name").each(function(category) {
|
||||
- var childCount = site.categories.find({ parent: category._id }).count();
|
||||
li.aside-category-list
|
||||
a.aside-category-list_link(href=url_for(category.path))
|
||||
span.aside-category-list_name= category.name
|
||||
span.aside-category-list_length= category.length
|
||||
|
||||
if childCount > 0
|
||||
ul.aside-category-item.child
|
||||
+displayCategories(category._id)
|
||||
- })
|
||||
|
||||
+displayCategories()
|
||||
!=aside_categories({ limit: theme.aside.card_categories.limit === 0 ? 0 : theme.aside.card_categories.limit || 8 })
|
||||
|
||||
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
.item-headline
|
||||
i.fa.fa-history(aria-hidden="true")
|
||||
span= _p('aside.card_recent_post')
|
||||
.aside-recent-item
|
||||
- site.posts.sort('date', -1).limit(5).each(function(article){
|
||||
.aside-recent-item
|
||||
- var postLimit = theme.aside.card_recent_post.limit === 0 ? site.posts.length : theme.aside.card_recent_post.limit || 5
|
||||
- site.posts.sort('date', -1).limit(postLimit).each(function(article){
|
||||
.aside-recent-post
|
||||
- var link = article.link || article.path
|
||||
- var title = article.title || _p('no_title')
|
||||
|
||||
@@ -4,4 +4,6 @@ if site.tags.length
|
||||
.item-headline
|
||||
i.fa.fa-tags(aria-hidden="true")
|
||||
span= _p('aside.card_tags')
|
||||
.card-tag-cloud!= tagcloud({min_font: 16, max_font: 24, amount: 200, color: true, start_color: '#999', end_color: '#99a9bf'})
|
||||
|
||||
- let tagLimit = theme.aside.card_tags.limit === 0 ? 0 : theme.aside.card_tags.limit || 40
|
||||
.card-tag-cloud!= tagcloud({min_font: 16, max_font: 24, amount: tagLimit , color: true, start_color: '#999', end_color: '#99a9bf'})
|
||||
|
||||
@@ -3,17 +3,17 @@ if theme.aside.enable
|
||||
#aside_content.aside_content
|
||||
if theme.aside.card_author
|
||||
!=partial('includes/widget/card_author', {}, {cache:theme.fragment_cache})
|
||||
if theme.aside.card_announcement
|
||||
if theme.aside.card_announcement.enable
|
||||
!=partial('includes/widget/card_announcement', {}, {cache:theme.fragment_cache})
|
||||
if theme.aside.card_recent_post
|
||||
if theme.aside.card_recent_post.enable
|
||||
!=partial('includes/widget/card_recent_post', {}, {cache:theme.fragment_cache})
|
||||
if theme.ad && theme.ad.aside
|
||||
!=partial('includes/widget/card_ad', {}, {cache:theme.fragment_cache})
|
||||
if theme.aside.card_categories
|
||||
if theme.aside.card_categories.enable
|
||||
!=partial('includes/widget/card_categories', {}, {cache:theme.fragment_cache})
|
||||
if theme.aside.card_tags
|
||||
if theme.aside.card_tags.enable
|
||||
!=partial('includes/widget/card_tags', {}, {cache:theme.fragment_cache})
|
||||
if theme.aside.card_archives
|
||||
if theme.aside.card_archives.enable
|
||||
!=partial('includes/widget/card_archives', {}, {cache:theme.fragment_cache})
|
||||
if theme.aside.card_webinfo
|
||||
!=partial('includes/widget/card_webinfo', {}, {cache:theme.fragment_cache})
|
||||
Reference in New Issue
Block a user