add theme
This commit is contained in:
3
themes/butterfly/layout/includes/widget/card_ad.pug
Normal file
3
themes/butterfly/layout/includes/widget/card_ad.pug
Normal file
@@ -0,0 +1,3 @@
|
||||
if theme.ad && theme.ad.aside
|
||||
.card-widget.ads-wrap
|
||||
!= theme.ad.aside
|
||||
@@ -0,0 +1,7 @@
|
||||
if theme.aside.card_announcement.enable
|
||||
.card-widget.card-announcement
|
||||
.item-headline
|
||||
i.fas.fa-bullhorn.fa-shake
|
||||
span= _p('aside.card_announcement')
|
||||
.announcement_content!= theme.aside.card_announcement.content
|
||||
#welcome-info
|
||||
@@ -0,0 +1,7 @@
|
||||
if theme.aside.card_archives.enable
|
||||
.card-widget.card-archives
|
||||
- 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 })
|
||||
26
themes/butterfly/layout/includes/widget/card_author.pug
Normal file
26
themes/butterfly/layout/includes/widget/card_author.pug
Normal file
@@ -0,0 +1,26 @@
|
||||
if theme.aside.card_author.enable
|
||||
.card-widget.card-info.text-center
|
||||
.avatar-img
|
||||
img(src=url_for(theme.avatar.img) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt="avatar")
|
||||
.author-info-name= config.author
|
||||
.author-info-description!= theme.aside.card_author.description || config.description
|
||||
|
||||
.site-data
|
||||
a(href=url_for(config.archive_dir) + '/')
|
||||
.headline= _p('aside.articles')
|
||||
.length-num= site.posts.length
|
||||
a(href=url_for(config.tag_dir) + '/')
|
||||
.headline= _p('aside.tags')
|
||||
.length-num= site.tags.length
|
||||
a(href=url_for(config.category_dir) + '/')
|
||||
.headline= _p('aside.categories')
|
||||
.length-num= site.categories.length
|
||||
|
||||
if theme.aside.card_author.button.enable
|
||||
a#card-info-btn(href=theme.aside.card_author.button.link)
|
||||
i(class=theme.aside.card_author.button.icon)
|
||||
span=theme.aside.card_author.button.text
|
||||
|
||||
if(theme.social)
|
||||
.card-info-social-icons
|
||||
!=partial('includes/header/social', {}, {cache: true})
|
||||
@@ -0,0 +1,9 @@
|
||||
if site.data.widget && site.data.widget.bottom
|
||||
each item in site.data.widget.bottom
|
||||
.card-widget(class=item.class_name id=item.id_name style=item.order ? `order: ${item.order}` : '')
|
||||
.item-headline
|
||||
i(class=item.icon)
|
||||
span=item.name
|
||||
.item-content
|
||||
!=item.html
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
if theme.aside.card_categories.enable
|
||||
if site.categories.length
|
||||
.card-widget.card-categories
|
||||
!=aside_categories({ limit: theme.aside.card_categories.limit === 0 ? 0 : theme.aside.card_categories.limit || 8 , expand: theme.aside.card_categories.expand })
|
||||
@@ -0,0 +1,7 @@
|
||||
if theme.aside.card_newest_comments.enable && theme.comments.use && !['Livere','Facebook Comments','Giscus'].includes(theme.comments.use[0])
|
||||
.card-widget#card-newest-comments
|
||||
.item-headline
|
||||
i.fas.fa-comment-dots
|
||||
span= _p('aside.card_newest_comments.headline')
|
||||
.aside-list
|
||||
span= _p('aside.card_newest_comments.loading_text')
|
||||
21
themes/butterfly/layout/includes/widget/card_post_series.pug
Normal file
21
themes/butterfly/layout/includes/widget/card_post_series.pug
Normal file
@@ -0,0 +1,21 @@
|
||||
if theme.aside.card_post_series.enable
|
||||
- const array = fragment_cache('seriesArr', groupPosts)
|
||||
.card-widget.card-post-series
|
||||
.item-headline
|
||||
i.fa-solid.fa-layer-group
|
||||
span= theme.aside.card_post_series.series_title ? page.series : _p('aside.card_post_series')
|
||||
.aside-list
|
||||
each item in array[page.series]
|
||||
- const { path, title = _p('no_title'), cover, cover_type, date:dateA } = item
|
||||
- let link = url_for(path)
|
||||
- let no_cover = cover === false || !theme.cover.aside_enable ? 'no-cover' : ''
|
||||
.aside-list-item(class=no_cover)
|
||||
if cover && theme.cover.aside_enable
|
||||
a.thumbnail(href=link title=title)
|
||||
if cover_type === 'img'
|
||||
img(src=url_for(cover) onerror=`this.onerror=null;this.src='${url_for(theme.error_img.post_page)}'` alt=title)
|
||||
else
|
||||
div(style=`background: ${cover}`)
|
||||
.content
|
||||
a.title(href=link title=title)= title
|
||||
time(datetime=date_xml(dateA) title=_p('post.created') + ' ' + full_date(dateA)) #[=date(dateA, config.date_format)]
|
||||
14
themes/butterfly/layout/includes/widget/card_post_toc.pug
Normal file
14
themes/butterfly/layout/includes/widget/card_post_toc.pug
Normal file
@@ -0,0 +1,14 @@
|
||||
- let tocNumber = typeof page.toc_number === 'boolean' ? page.toc_number : theme.toc.number
|
||||
- let tocExpand = typeof page.toc_expand === 'boolean' ? page.toc_expand : theme.toc.expand
|
||||
- let tocExpandClass = tocExpand ? 'is-expand' : ''
|
||||
|
||||
#card-toc.card-widget
|
||||
.item-headline
|
||||
i.fas.fa-stream
|
||||
span= _p('aside.card_toc')
|
||||
span.toc-percentage
|
||||
|
||||
if (page.encrypt == true)
|
||||
.toc-content.toc-div-class(class=tocExpandClass style="display:none")!=toc(page.origin, {list_number: tocNumber})
|
||||
else
|
||||
.toc-content(class=tocExpandClass)!=toc(page.content, {list_number: tocNumber})
|
||||
27
themes/butterfly/layout/includes/widget/card_recent_post.pug
Normal file
27
themes/butterfly/layout/includes/widget/card_recent_post.pug
Normal file
@@ -0,0 +1,27 @@
|
||||
if theme.aside.card_recent_post.enable
|
||||
.card-widget.card-recent-post
|
||||
.item-headline
|
||||
i.fas.fa-history
|
||||
span= _p('aside.card_recent_post')
|
||||
.aside-list
|
||||
- let postLimit = theme.aside.card_recent_post.limit === 0 ? site.posts.length : theme.aside.card_recent_post.limit || 5
|
||||
- let sort = theme.aside.card_recent_post.sort === 'updated' ? 'updated' : 'date'
|
||||
- site.posts.sort(sort, -1).limit(postLimit).each(function(article){
|
||||
- let link = article.link || article.path
|
||||
- let title = article.title || _p('no_title')
|
||||
- let no_cover = article.cover === false || !theme.cover.aside_enable ? 'no-cover' : ''
|
||||
- let post_cover = article.cover
|
||||
.aside-list-item(class=no_cover)
|
||||
if post_cover && theme.cover.aside_enable
|
||||
a.thumbnail(href=url_for(link) title=title)
|
||||
if article.cover_type === 'img'
|
||||
img(src=url_for(post_cover) onerror=`this.onerror=null;this.src='${url_for(theme.error_img.post_page)}'` alt=title)
|
||||
else
|
||||
div(style=`background: ${post_cover}`)
|
||||
.content
|
||||
a.title(href=url_for(link) title=title)= title
|
||||
if theme.aside.card_recent_post.sort === 'updated'
|
||||
time(datetime=date_xml(article.updated) title=_p('post.updated') + ' ' + full_date(article.updated)) #[=date(article.updated, config.date_format)]
|
||||
else
|
||||
time(datetime=date_xml(article.date) title=_p('post.created') + ' ' + full_date(article.date)) #[=date(article.date, config.date_format)]
|
||||
- })
|
||||
14
themes/butterfly/layout/includes/widget/card_tags.pug
Normal file
14
themes/butterfly/layout/includes/widget/card_tags.pug
Normal file
@@ -0,0 +1,14 @@
|
||||
if theme.aside.card_tags.enable
|
||||
if site.tags.length
|
||||
.card-widget.card-tags
|
||||
.item-headline
|
||||
i.fas.fa-tags
|
||||
span= _p('aside.card_tags')
|
||||
|
||||
- let { limit, orderby, order } = theme.aside.card_tags
|
||||
- limit = limit === 0 ? 0 : limit || 40
|
||||
|
||||
if theme.aside.card_tags.color
|
||||
.card-tag-cloud!= cloudTags({source: site.tags, orderby: orderby, order: order, minfontsize: 1.15, maxfontsize: 1.45, limit: limit, unit: 'em'})
|
||||
else
|
||||
.card-tag-cloud!= tagcloud({orderby: orderby, order: order, min_font: 1.1, max_font: 1.5, amount: limit , color: true, start_color: '#999', end_color: '#99a9bf', unit: 'em'})
|
||||
@@ -0,0 +1,8 @@
|
||||
if site.data.widget && site.data.widget.top
|
||||
each item in site.data.widget.top
|
||||
.card-widget(class=item.class_name id=item.id_name)
|
||||
.item-headline
|
||||
i(class=item.icon)
|
||||
span=item.name
|
||||
.item-content
|
||||
!=item.html
|
||||
44
themes/butterfly/layout/includes/widget/card_webinfo.pug
Normal file
44
themes/butterfly/layout/includes/widget/card_webinfo.pug
Normal file
@@ -0,0 +1,44 @@
|
||||
if theme.aside.card_webinfo.enable
|
||||
.card-widget.card-webinfo
|
||||
.item-headline
|
||||
i.fas.fa-chart-line
|
||||
span= _p('aside.card_webinfo.headline')
|
||||
.webinfo
|
||||
if theme.aside.card_webinfo.post_count
|
||||
.webinfo-item
|
||||
.item-name= `${_p('aside.card_webinfo.article_name')} :`
|
||||
.item-count= site.posts.length
|
||||
if theme.aside.card_webinfo.runtime_date
|
||||
.webinfo-item
|
||||
.item-name= `${_p('aside.card_webinfo.runtime.name')} :`
|
||||
.item-count#runtimeshow(data-publishDate=date_xml(theme.aside.card_webinfo.runtime_date))
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
if theme.wordcount.enable && theme.wordcount.total_wordcount
|
||||
.webinfo-item
|
||||
.item-name= `${_p('aside.card_webinfo.site_wordcount')} :`
|
||||
.item-count= totalcount(site)
|
||||
if theme.umami_analytics.enable && theme.umami_analytics.UV_PV.site_uv
|
||||
.webinfo-item
|
||||
.item-name= `${_p('aside.card_webinfo.site_uv_name')} :`
|
||||
.item-count#umami-site-uv
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
else if theme.busuanzi.site_uv
|
||||
.webinfo-item
|
||||
.item-name= `${_p('aside.card_webinfo.site_uv_name')} :`
|
||||
.item-count#busuanzi_value_site_uv
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
if theme.umami_analytics.enable && theme.umami_analytics.UV_PV.site_pv
|
||||
.webinfo-item
|
||||
.item-name= `${_p('aside.card_webinfo.site_pv_name')} :`
|
||||
.item-count#umami-site-pv
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
else if theme.busuanzi.site_pv
|
||||
.webinfo-item
|
||||
.item-name= `${_p('aside.card_webinfo.site_pv_name')} :`
|
||||
.item-count#busuanzi_value_site_pv
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
if theme.aside.card_webinfo.last_push_date
|
||||
.webinfo-item
|
||||
.item-name= `${_p('aside.card_webinfo.last_push_date.name')} :`
|
||||
.item-count#last-push-date(data-lastPushDate=date_xml(Date.now()))
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
36
themes/butterfly/layout/includes/widget/index.pug
Normal file
36
themes/butterfly/layout/includes/widget/index.pug
Normal file
@@ -0,0 +1,36 @@
|
||||
#aside-content.aside-content
|
||||
//- post
|
||||
if globalPageType === 'post'
|
||||
- const tocStyle = page.toc_style_simple
|
||||
- const tocStyleVal = tocStyle === true || tocStyle === false ? tocStyle : theme.toc.style_simple
|
||||
if showToc && tocStyleVal
|
||||
.sticky_layout
|
||||
include ./card_post_toc.pug
|
||||
else
|
||||
!=partial('includes/widget/card_author', {}, {cache: true})
|
||||
!=partial('includes/widget/card_announcement', {}, {cache: true})
|
||||
!=partial('includes/widget/card_top_self', {}, {cache: true})
|
||||
.sticky_layout
|
||||
if showToc
|
||||
include ./card_post_toc.pug
|
||||
if page.series
|
||||
include ./card_post_series.pug
|
||||
!=partial('includes/widget/card_recent_post', {}, {cache: true})
|
||||
!=partial('includes/widget/card_ad', {}, {cache: true})
|
||||
else
|
||||
//- page
|
||||
!=partial('includes/widget/card_author', {}, {cache: true})
|
||||
!=partial('includes/widget/card_announcement', {}, {cache: true})
|
||||
!=partial('includes/widget/card_top_self', {}, {cache: true})
|
||||
|
||||
.sticky_layout
|
||||
if showToc
|
||||
include ./card_post_toc.pug
|
||||
!=partial('includes/widget/card_recent_post', {}, {cache: true})
|
||||
!=partial('includes/widget/card_ad', {}, {cache: true})
|
||||
!=partial('includes/widget/card_newest_comment', {}, {cache: true})
|
||||
!=partial('includes/widget/card_categories', {}, {cache: true})
|
||||
!=partial('includes/widget/card_tags', {}, {cache: true})
|
||||
!=partial('includes/widget/card_archives', {}, {cache: true})
|
||||
!=partial('includes/widget/card_webinfo', {}, {cache: true})
|
||||
!=partial('includes/widget/card_bottom_self', {}, {cache: true})
|
||||
Reference in New Issue
Block a user