mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-12 22:17:06 +08:00
feat: 添加 artitalk 説説插件
style: 主題文件分類調正
This commit is contained in:
@@ -751,6 +751,13 @@ note:
|
|||||||
# other
|
# other
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
|
|
||||||
|
# Artitalk
|
||||||
|
# see https://artitalk.js.org/
|
||||||
|
artitalk:
|
||||||
|
appId:
|
||||||
|
appKey:
|
||||||
|
option:
|
||||||
|
|
||||||
# Pjax [Beta]
|
# Pjax [Beta]
|
||||||
# It may contain bugs and unstable, give feedback when you find the bugs.
|
# It may contain bugs and unstable, give feedback when you find the bugs.
|
||||||
# https://github.com/MoOx/pjax
|
# https://github.com/MoOx/pjax
|
||||||
@@ -910,3 +917,5 @@ CDN:
|
|||||||
prismjs_js: https://cdn.jsdelivr.net/npm/prismjs/prism.min.js
|
prismjs_js: https://cdn.jsdelivr.net/npm/prismjs/prism.min.js
|
||||||
prismjs_lineNumber_js: https://cdn.jsdelivr.net/npm/prismjs/plugins/line-numbers/prism-line-numbers.min.js
|
prismjs_lineNumber_js: https://cdn.jsdelivr.net/npm/prismjs/plugins/line-numbers/prism-line-numbers.min.js
|
||||||
prismjs_autoloader: https://cdn.jsdelivr.net/npm/prismjs/plugins/autoloader/prism-autoloader.min.js
|
prismjs_autoloader: https://cdn.jsdelivr.net/npm/prismjs/plugins/autoloader/prism-autoloader.min.js
|
||||||
|
|
||||||
|
artitalk: https://cdn.jsdelivr.net/npm/artitalk
|
||||||
@@ -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})
|
|
||||||
|
|
||||||
|
|
||||||
@@ -36,6 +36,9 @@ div
|
|||||||
if theme.subtitle.enable && is_home() && theme.index_img !== false
|
if theme.subtitle.enable && is_home() && theme.index_img !== false
|
||||||
include ./third-party/subtitle.pug
|
include ./third-party/subtitle.pug
|
||||||
|
|
||||||
|
if page.type === 'artitalk'
|
||||||
|
include ./third-party/artitalk.pug
|
||||||
|
|
||||||
include ./third-party/math/index.pug
|
include ./third-party/math/index.pug
|
||||||
|
|
||||||
if commentsJsLoad
|
if commentsJsLoad
|
||||||
|
|||||||
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
|
extends includes/layout.pug
|
||||||
|
|
||||||
block content
|
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
|
#page
|
||||||
if theme.douban && theme.douban.meta && doubanExist
|
case page.type
|
||||||
meta(name="referrer" content="no-referrer")
|
when 'tags'
|
||||||
#article-container
|
include includes/page/tags.pug
|
||||||
if top_img === false
|
when 'link'
|
||||||
h1.page-title= page.title
|
include includes/page/flink.pug
|
||||||
!= page.content
|
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
|
if page.comments !== false && theme.comments && theme.comments.use
|
||||||
- var commentsJsLoad = true
|
- var commentsJsLoad = true
|
||||||
!=partial('includes/third-party/comments/index', {}, {cache:theme.fragment_cache})
|
!=partial('includes/third-party/comments/index', {}, {cache:theme.fragment_cache})
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hexo-theme-butterfly",
|
"name": "hexo-theme-butterfly",
|
||||||
"version": "3.2.0-b4",
|
"version": "3.2.0-b5",
|
||||||
"description": "A Simple and Card UI Design theme for Hexo",
|
"description": "A Simple and Card UI Design theme for Hexo",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -162,3 +162,8 @@ if hexo-config('darkmode.enable') || hexo-config('display_mode') == 'dark'
|
|||||||
|
|
||||||
blockquote
|
blockquote
|
||||||
color: alpha(#FFFFFF, .7)
|
color: alpha(#FFFFFF, .7)
|
||||||
|
|
||||||
|
#artitalk_main #lazy
|
||||||
|
background: #121212
|
||||||
|
#operare_artitalk .c2
|
||||||
|
background: #121212
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
.category-content
|
#page
|
||||||
.category-lists
|
.category-lists
|
||||||
padding: 1rem 0 1.5rem
|
padding: 1rem 0 1.5rem
|
||||||
|
|
||||||
+maxWidth768()
|
+maxWidth768()
|
||||||
padding: 0
|
padding: 0
|
||||||
|
|
||||||
.category__title
|
.category-title
|
||||||
text-align: center
|
|
||||||
font-size: 2.57em
|
font-size: 2.57em
|
||||||
|
|
||||||
+maxWidth768()
|
+maxWidth768()
|
||||||
|
|||||||
@@ -39,13 +39,8 @@
|
|||||||
&:hover
|
&:hover
|
||||||
box-shadow: 0 4px 12px 12px rgba(7, 17, 27, .15)
|
box-shadow: 0 4px 12px 12px rgba(7, 17, 27, .15)
|
||||||
|
|
||||||
+minWidth900()
|
if hexo-config('aside.position') == 'left'
|
||||||
if hexo-config('aside.position') == 'left'
|
+minWidth900()
|
||||||
#recent-posts,
|
.layout_page
|
||||||
#page,
|
& > div:first-child
|
||||||
.category-content,
|
|
||||||
#archive,
|
|
||||||
.tag-cloud,
|
|
||||||
#tag,
|
|
||||||
#category
|
|
||||||
order: 2
|
order: 2
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
.tag-cloud
|
.tag-cloud
|
||||||
text-align: center
|
&-list
|
||||||
|
|
||||||
a
|
a
|
||||||
display: inline-block
|
display: inline-block
|
||||||
padding: 0 .4rem
|
padding: 0 .4rem
|
||||||
@@ -13,7 +12,7 @@
|
|||||||
+maxWidth768()
|
+maxWidth768()
|
||||||
zoom: .85
|
zoom: .85
|
||||||
|
|
||||||
&__title
|
&-title
|
||||||
font-size: 2.57em
|
font-size: 2.57em
|
||||||
|
|
||||||
+maxWidth768()
|
+maxWidth768()
|
||||||
|
|||||||
Reference in New Issue
Block a user