mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-10 21:17:07 +08:00
feat: 添加 artitalk 説説插件
style: 主題文件分類調正
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
#page
|
||||
.flink#article-container
|
||||
if site.data.link
|
||||
each i in site.data.link
|
||||
if i.class_name
|
||||
h2!= i.class_name
|
||||
if i.class_desc
|
||||
.flink-desc!=i.class_desc
|
||||
.flink-list
|
||||
each item in i.link_list
|
||||
.flink-list-item
|
||||
a(href=url_for(item.link) title=item.name target="_blank")
|
||||
if theme.lazyload.enable
|
||||
img(data-lazy-src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt=item.name )
|
||||
else
|
||||
img(src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt=item.name )
|
||||
span.flink-item-name= item.name
|
||||
span.flink-item-desc(title=item.descr)= item.descr
|
||||
!= page.content
|
||||
if page.comments !== false && theme.comments && theme.comments.use
|
||||
- var commentsJsLoad = true
|
||||
!=partial('includes/third-party/comments/index', {}, {cache:theme.fragment_cache})
|
||||
|
||||
|
||||
@@ -35,6 +35,9 @@ div
|
||||
.js-pjax
|
||||
if theme.subtitle.enable && is_home() && theme.index_img !== false
|
||||
include ./third-party/subtitle.pug
|
||||
|
||||
if page.type === 'artitalk'
|
||||
include ./third-party/artitalk.pug
|
||||
|
||||
include ./third-party/math/index.pug
|
||||
|
||||
|
||||
1
layout/includes/page/artitalk.pug
Normal file
1
layout/includes/page/artitalk.pug
Normal file
@@ -0,0 +1 @@
|
||||
#artitalk_main
|
||||
5
layout/includes/page/categories.pug
Normal file
5
layout/includes/page/categories.pug
Normal file
@@ -0,0 +1,5 @@
|
||||
.category-lists
|
||||
.category-title.is-center= _p('page.category')
|
||||
| -
|
||||
span.category-amount= site.categories.length
|
||||
div!= list_categories()
|
||||
6
layout/includes/page/default-page.pug
Normal file
6
layout/includes/page/default-page.pug
Normal file
@@ -0,0 +1,6 @@
|
||||
if theme.douban && theme.douban.meta && doubanExist
|
||||
meta(name="referrer" content="no-referrer")
|
||||
#article-container
|
||||
if top_img === false
|
||||
h1.page-title= page.title
|
||||
!= page.content
|
||||
19
layout/includes/page/flink.pug
Normal file
19
layout/includes/page/flink.pug
Normal file
@@ -0,0 +1,19 @@
|
||||
.flink#article-container
|
||||
if site.data.link
|
||||
each i in site.data.link
|
||||
if i.class_name
|
||||
h2!= i.class_name
|
||||
if i.class_desc
|
||||
.flink-desc!=i.class_desc
|
||||
.flink-list
|
||||
each item in i.link_list
|
||||
.flink-list-item
|
||||
a(href=url_for(item.link) title=item.name target="_blank")
|
||||
if theme.lazyload.enable
|
||||
img(data-lazy-src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt=item.name )
|
||||
else
|
||||
img(src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt=item.name )
|
||||
span.flink-item-name= item.name
|
||||
span.flink-item-desc(title=item.descr)= item.descr
|
||||
!= page.content
|
||||
|
||||
5
layout/includes/page/tags.pug
Normal file
5
layout/includes/page/tags.pug
Normal file
@@ -0,0 +1,5 @@
|
||||
.tag-cloud-title.is-center= _p('page.tag')
|
||||
| -
|
||||
span.tag-cloud-amount= site.tags.length
|
||||
.tag-cloud-list.is-center
|
||||
!=cloudTags({source: site.tags, minfontsize: 1.2, maxfontsize: 2.1, limit: 0, unit: 'em'})
|
||||
24
layout/includes/third-party/artitalk.pug
vendored
Normal file
24
layout/includes/third-party/artitalk.pug
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
- let option = theme.artitalk.option ? JSON.stringify(theme.artitalk.option) : false
|
||||
|
||||
script.
|
||||
(()=>{
|
||||
let setting = {
|
||||
appId: '!{theme.artitalk.appId}',
|
||||
appKey: '!{theme.artitalk.appKey}',
|
||||
}
|
||||
|
||||
if (!{Boolean(option)}) {
|
||||
const otherSetting = !{option}
|
||||
setting = Object.assign({}, setting, otherSetting)
|
||||
}
|
||||
|
||||
const init = () => {
|
||||
new Artitalk(setting)
|
||||
}
|
||||
|
||||
if (typeof Artitalk === 'function') {
|
||||
init()
|
||||
} else {
|
||||
$.getScript('!{theme.CDN.artitalk}',init)
|
||||
}
|
||||
})()
|
||||
@@ -1,36 +1,19 @@
|
||||
extends includes/layout.pug
|
||||
|
||||
block content
|
||||
if page.type === 'tags'
|
||||
.tag-cloud
|
||||
.tag-cloud__title= _p('page.tag')
|
||||
| -
|
||||
span.tag-cloud__amount= site.tags.length
|
||||
.tag-cloud-tags
|
||||
!=cloudTags({source: site.tags, minfontsize: 1.2, maxfontsize: 2.1, limit: 0, unit: 'em'})
|
||||
if page.comments !== false && theme.comments && theme.comments.use
|
||||
- var commentsJsLoad = true
|
||||
!=partial('includes/third-party/comments/index', {}, {cache:theme.fragment_cache})
|
||||
else if page.type === 'link'
|
||||
include flink.pug
|
||||
else if page.type === 'categories'
|
||||
.category-content
|
||||
.category-lists
|
||||
.category__title= _p('page.category')
|
||||
| -
|
||||
span.category__amount= site.categories.length
|
||||
div!= list_categories()
|
||||
if page.comments !== false && theme.comments && theme.comments.use
|
||||
- var commentsJsLoad = true
|
||||
!=partial('includes/third-party/comments/index', {}, {cache:theme.fragment_cache})
|
||||
else
|
||||
#page
|
||||
if theme.douban && theme.douban.meta && doubanExist
|
||||
meta(name="referrer" content="no-referrer")
|
||||
#article-container
|
||||
if top_img === false
|
||||
h1.page-title= page.title
|
||||
!= page.content
|
||||
if page.comments !== false && theme.comments && theme.comments.use
|
||||
- var commentsJsLoad = true
|
||||
!=partial('includes/third-party/comments/index', {}, {cache:theme.fragment_cache})
|
||||
#page
|
||||
case page.type
|
||||
when 'tags'
|
||||
include includes/page/tags.pug
|
||||
when 'link'
|
||||
include includes/page/flink.pug
|
||||
when 'categories'
|
||||
include includes/page/categories.pug
|
||||
when 'artitalk'
|
||||
include includes/page/artitalk.pug
|
||||
default
|
||||
include includes/page/default-page.pug
|
||||
|
||||
if page.comments !== false && theme.comments && theme.comments.use
|
||||
- var commentsJsLoad = true
|
||||
!=partial('includes/third-party/comments/index', {}, {cache:theme.fragment_cache})
|
||||
Reference in New Issue
Block a user