perf: reduce Valine configuration items

This commit is contained in:
XPoet 2021-01-05 17:05:14 +08:00
parent bb7e05d174
commit f745beaa29
2 changed files with 77 additions and 88 deletions

View File

@ -31,7 +31,7 @@ style:
# Mouse hover
hover:
shadow: true # shadow effect when the mouse hover
shadow: false # shadow effect when the mouse hover
scale: false # scale effect when the mouse hover
# First screen
@ -67,16 +67,81 @@ menu:
# Tags: /tags
# Links: /links
# About: /about
# ...
# ......
# ---------------------------------------------------------------------------------------
# RSS
# Dependencies: hexo-generator-feed
# See: https://github.com/hexojs/hexo-generator-feed
# Home page article block display settings
# ---------------------------------------------------------------------------------------
rss:
home_article:
category:
enable: false # show category in home page article block
limit: 3 # max number of categories shown in home page article block
tag:
enable: false # show tags in home page article block
limit: 5 # max number of tags shown in home page article block
# ---------------------------------------------------------------------------------------
# Code copy
# ---------------------------------------------------------------------------------------
code_copy:
enable: false
style: default # values: default | mac
# ---------------------------------------------------------------------------------------
# Table of Contents in the Sidebar
# ---------------------------------------------------------------------------------------
toc:
enable: false
# Automatically add list number to toc.
number: true
# If true, all level of TOC in a post will be displayed, rather than the activated part of it.
expand_all: true
# ---------------------------------------------------------------------------------------
# Post copyright info
# ---------------------------------------------------------------------------------------
copyright_info:
enable: true
# ---------------------------------------------------------------------------------------
# Post word count
# Dependencies: hexo-wordcount
# See: https://github.com/willin/hexo-wordcount
# ---------------------------------------------------------------------------------------
post_wordcount:
enable: false
wordcount: false # word count, one article
min2read: false # time to read, one article
# ---------------------------------------------------------------------------------------
# Website count
# ---------------------------------------------------------------------------------------
website_count:
# busuanzi
# See: http://ibruce.info/2015/04/04/busuanzi/
busuanzi_count:
enable: false
site_uv: false
site_pv: false
page_pv: false
# ---------------------------------------------------------------------------------------
# Local Search
# Dependencies: hexo-generator-searchdb
# See: https://github.com/theme-next/hexo-generator-searchdb
# ---------------------------------------------------------------------------------------
local_search:
enable: false
preload: false # Preload the search data when the page loads
# ---------------------------------------------------------------------------------------
@ -103,86 +168,12 @@ comment:
# ---------------------------------------------------------------------------------------
# Website count
# RSS
# Dependencies: hexo-generator-feed
# See: https://github.com/hexojs/hexo-generator-feed
# ---------------------------------------------------------------------------------------
website_count:
# busuanzi
# See: http://ibruce.info/2015/04/04/busuanzi/
busuanzi_count:
rss:
enable: false
site_uv: false
site_pv: false
page_pv: false
# ---------------------------------------------------------------------------------------
# Local Search
# Dependencies: hexo-generator-searchdb
# See: https://github.com/theme-next/hexo-generator-searchdb
# ---------------------------------------------------------------------------------------
local_search:
enable: false
# If auto, trigger search by changing input.
# If manual, trigger search by pressing enter key or search button.
trigger: auto # values: auto | manual
# Unescape html strings to the readable one.
unescape: false
# Preload the search data when the page loads.
preload: false
# ---------------------------------------------------------------------------------------
# Post word count
# Dependencies: hexo-wordcount
# See: https://github.com/willin/hexo-wordcount
# ---------------------------------------------------------------------------------------
post_wordcount:
enable: false
wordcount: false # word count, one article
min2read: false # time to read, one article
# ---------------------------------------------------------------------------------------
# Home page article block display settings
# ---------------------------------------------------------------------------------------
home_article:
category:
enable: false # show category in home page article block
limit: 3 # max number of categories shown in home page article block
tag:
enable: false # show tags in home page article block
limit: 5 # max number of tags shown in home page article block
# ---------------------------------------------------------------------------------------
# Code copy
# ---------------------------------------------------------------------------------------
code_copy:
enable: true
style: default # values: default | mac
# ---------------------------------------------------------------------------------------
# Table of Contents in the Sidebar
# ---------------------------------------------------------------------------------------
toc:
enable: false
# Automatically add list number to toc.
number: true
# If true, all level of TOC in a post will be displayed, rather than the activated part of it.
expand_all: true
# ---------------------------------------------------------------------------------------
# Post copyright info
# ---------------------------------------------------------------------------------------
copyright_info:
enable: true
# ---------------------------------------------------------------------------------------

View File

@ -8,14 +8,12 @@
src="//cdn.jsdelivr.net/npm/valine@latest/dist/Valine.min.js"></script>
<div id="vcomments"></div>
<script <%= theme.pjax.enable === true ? 'data-pjax' : '' %>>
function loadValine() {
const temp_valine_input_meta = '<%= theme.comment.valine.meta %>';
new Valine({
el: '#vcomments',
appId: '<%= theme.comment.valine.appid %>',
appKey: '<%= theme.comment.valine.appkey %>',
meta: temp_valine_input_meta ? temp_valine_input_meta.split(',') : ['nick', 'mail', 'link'],
meta: ['nick', 'mail', 'link'],
avatar: 'wavatar',
enableQQ: true,
placeholder: '<%= theme.comment.valine.placeholder %>',