feat: 添加 artitalk 説説插件

style: 主題文件分類調正
This commit is contained in:
Jerry
2020-09-16 23:09:34 +08:00
parent 938e7a04c7
commit c7318a3793
16 changed files with 112 additions and 83 deletions

View File

@@ -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

View File

@@ -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})

View File

@@ -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

View File

@@ -0,0 +1 @@
#artitalk_main

View File

@@ -0,0 +1,5 @@
.category-lists
.category-title.is-center= _p('page.category')
| -
span.category-amount= site.categories.length
div!= list_categories()

View 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

View 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

View 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'})

View 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)
}
})()

View File

@@ -1,36 +1,19 @@
extends includes/layout.pug extends includes/layout.pug
block content block content
if page.type === 'tags' #page
.tag-cloud case page.type
.tag-cloud__title= _p('page.tag') when 'tags'
| - include includes/page/tags.pug
span.tag-cloud__amount= site.tags.length when 'link'
.tag-cloud-tags include includes/page/flink.pug
!=cloudTags({source: site.tags, minfontsize: 1.2, maxfontsize: 2.1, limit: 0, unit: 'em'}) when 'categories'
if page.comments !== false && theme.comments && theme.comments.use include includes/page/categories.pug
- var commentsJsLoad = true when 'artitalk'
!=partial('includes/third-party/comments/index', {}, {cache:theme.fragment_cache}) include includes/page/artitalk.pug
else if page.type === 'link' default
include flink.pug include includes/page/default-page.pug
else if page.type === 'categories'
.category-content if page.comments !== false && theme.comments && theme.comments.use
.category-lists - var commentsJsLoad = true
.category__title= _p('page.category') !=partial('includes/third-party/comments/index', {}, {cache:theme.fragment_cache})
| -
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})

View File

@@ -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": {

View File

@@ -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

View File

@@ -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()

View File

@@ -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, order: 2
#archive,
.tag-cloud,
#tag,
#category
order: 2

View File

@@ -1,19 +1,18 @@
.tag-cloud .tag-cloud
text-align: center &-list
a
display: inline-block
padding: 0 .4rem
transition: all .3s
a &:hover
display: inline-block color: $text-hover !important
padding: 0 .4rem transform: scale(1.1)
transition: all .3s
&:hover +maxWidth768()
color: $text-hover !important zoom: .85
transform: scale(1.1)
+maxWidth768() &-title
zoom: .85
&__title
font-size: 2.57em font-size: 2.57em
+maxWidth768() +maxWidth768()