diff --git a/themes/yilia/_config.yml b/themes/yilia/_config.yml index a9cfe42..07e1bee 100644 --- a/themes/yilia/_config.yml +++ b/themes/yilia/_config.yml @@ -61,8 +61,6 @@ toc: 2 toc_hide_index: true # 是否显示文章列表页的动画效果 animate: true -# 文章全文页面是否开启评论 -comment: true # 目录为空时的提示 toc_empty_wording: 目录,不存在的… diff --git a/themes/yilia/layout/_partial/after-footer.ejs b/themes/yilia/layout/_partial/after-footer.ejs index a0b9c14..a326a47 100644 --- a/themes/yilia/layout/_partial/after-footer.ejs +++ b/themes/yilia/layout/_partial/after-footer.ejs @@ -7,7 +7,6 @@ window.themeConfig = { isCategory: <%=is_category()%>, // 是否为分类页面 pageid: <%-page.pageid ? `"${page.pageid}"` : 'undefined'%>, // 页面标识, 用于个性化页面开发 toc_hide_index: <%=theme.toc_hide_index%>, // 目录序号 - comment: <%=theme.comment%>, // 文章全文页面是否开启评论 animate: <%=theme.animate%>, // 是否显示文章列表页动画效果 root: '<%=config.root%>', // 资源根路径 baseUrl: '<%=config.url%>', diff --git a/themes/yilia/layout/_partial/article.ejs b/themes/yilia/layout/_partial/article.ejs index b2fa6ca..04af8fa 100644 --- a/themes/yilia/layout/_partial/article.ejs +++ b/themes/yilia/layout/_partial/article.ejs @@ -91,7 +91,3 @@ <% if (!param.index){ %> <%- partial('post/nav') %> <% } %> - -<% if (!param.index && post.comments && theme.valine.enable){ %> -
-<% } %> \ No newline at end of file diff --git a/themes/yilia/package-lock.json b/themes/yilia/package-lock.json index e99109a..9591413 100644 --- a/themes/yilia/package-lock.json +++ b/themes/yilia/package-lock.json @@ -2882,9 +2882,9 @@ } }, "node_modules/css-loader/node_modules/loader-utils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz", - "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", + "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", "dev": true, "dependencies": { "big.js": "^5.2.2", @@ -3337,9 +3337,9 @@ } }, "node_modules/file-loader/node_modules/loader-utils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz", - "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", + "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", "dev": true, "dependencies": { "big.js": "^5.2.2", @@ -4167,9 +4167,9 @@ } }, "node_modules/loader-utils": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", - "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", "dev": true, "dependencies": { "big.js": "^5.2.2", @@ -5748,9 +5748,9 @@ } }, "node_modules/url-loader/node_modules/loader-utils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz", - "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", + "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", "dev": true, "dependencies": { "big.js": "^5.2.2", @@ -8212,9 +8212,9 @@ }, "dependencies": { "loader-utils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz", - "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", + "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", "dev": true, "requires": { "big.js": "^5.2.2", @@ -8544,9 +8544,9 @@ }, "dependencies": { "loader-utils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz", - "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", + "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", "dev": true, "requires": { "big.js": "^5.2.2", @@ -9153,9 +9153,9 @@ "dev": true }, "loader-utils": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", - "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", "dev": true, "requires": { "big.js": "^5.2.2", @@ -10308,9 +10308,9 @@ }, "dependencies": { "loader-utils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz", - "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", + "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", "dev": true, "requires": { "big.js": "^5.2.2", diff --git a/themes/yilia/source-src/css/article-main.scss b/themes/yilia/source-src/css/article-main.scss index 49e0463..b042816 100644 --- a/themes/yilia/source-src/css/article-main.scss +++ b/themes/yilia/source-src/css/article-main.scss @@ -18,10 +18,6 @@ max-width: 100%; } } -#comments { - margin:0 30px; - background-color:$colorBg; -} .article-inner h1.article-title, .article-title { color: #696969; margin-left: 0px; diff --git a/themes/yilia/source-src/css/mobile.scss b/themes/yilia/source-src/css/mobile.scss index 1b0b1f6..f206ad0 100644 --- a/themes/yilia/source-src/css/mobile.scss +++ b/themes/yilia/source-src/css/mobile.scss @@ -195,9 +195,6 @@ display: block; } } -#comments { - margin: 0; -} .share{ padding: 3px 10px; } diff --git a/themes/yilia/source-src/css/night.scss b/themes/yilia/source-src/css/night.scss index ac0921a..267dc75 100644 --- a/themes/yilia/source-src/css/night.scss +++ b/themes/yilia/source-src/css/night.scss @@ -100,10 +100,6 @@ body.night { .profilepic, .waifu, #header .header-nav .social a { filter: brightness(30%); } - // 评论 - #comments { - background: none; - } // 文章信息栏 .article-info-index.article-info { border-top-color: $borderColor_night; diff --git a/themes/yilia/source-src/js/comment.js b/themes/yilia/source-src/js/comment.js deleted file mode 100644 index 7303e97..0000000 --- a/themes/yilia/source-src/js/comment.js +++ /dev/null @@ -1,19 +0,0 @@ -const axios = require('axios') -// const AV = require('leancloud-storage') -window.AV = require('leancloud-storage') -// const Valine = require('../lib/Valine.min') -/** - * 使用根据Valine项目源代码重新打包 - * 可以支持对于AV对象的传参输入, 而不需要暴露全局变量 - * 但是缺少一些新功能 - */ - -import(/* webpackChunkName: "valine" */ '../lib/Valine.min').then(({default: Valine }) => { - // 从接口获取评论配置 - axios.get(`${window.themeConfig.root}api/v1/common/config/valine_config`).then(res => { - let config = res.data - config.path = window.location.pathname - // config.av = AV - new Valine(config) - }) -}) diff --git a/themes/yilia/source-src/js/main.js b/themes/yilia/source-src/js/main.js index ed517a0..b62349a 100644 --- a/themes/yilia/source-src/js/main.js +++ b/themes/yilia/source-src/js/main.js @@ -42,11 +42,6 @@ Util.addLoadEvent(function() { } }) -if(window.themeConfig.isPost && window.themeConfig.comment) { - // 文章详情页面, 并且启用了评论, 则加载评论相关代码 - import(/* webpackChunkName: "comment" */ './comment') -} - // 初始化看板娘 import(/* webpackChunkName: "waifu" */ './waifu').then(waifuInit => { waifuInit.default.init() diff --git a/themes/yilia/source-src/lib/Valine.min.js b/themes/yilia/source-src/lib/Valine.min.js deleted file mode 100644 index 0238ae6..0000000 --- a/themes/yilia/source-src/lib/Valine.min.js +++ /dev/null @@ -1,11 +0,0 @@ -/*! - * Valine v1.3.3 - * (c) 2017-2018 xCss - * Released under the GPL-2.0 License. - */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Valine=t():e.Valine=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=16)}([function(e,t,n){var r,i,o;/*! - autosize 4.0.2 - license: MIT - http://www.jacklmoore.com/autosize -*/ -!function(n,a){i=[e,t],r=a,void 0!==(o="function"==typeof r?r.apply(t,i):r)&&(e.exports=o)}(0,function(e,t){"use strict";function n(e){function t(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function n(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}function r(){if(0!==e.scrollHeight){var t=n(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+s+"px",l=e.clientWidth,t.forEach(function(e){e.node.scrollTop=e.scrollTop}),r&&(document.documentElement.scrollTop=r)}}function i(){r();var n=Math.round(parseFloat(e.style.height)),i=window.getComputedStyle(e,null),o="content-box"===i.boxSizing?Math.round(parseFloat(i.height)):e.offsetHeight;if(oCode '+n+": "+i+"")||console}else t.el&&t.nodata.show('
'+JSON.stringify(e)+"")||console},r.prototype.installLocale=function(e,t){var n=this;return t=t||{},e&&(h[e]=t,n.locale=h[e]||h["zh-cn"]),n},r.prototype.setPath=function(e){return b=e||b,this},r.prototype.bind=function(e){var t=this,n=d.find(t.el,".vemojis"),r=d.find(t.el,".vpreview"),i=d.find(t.el,".vemoji-btn"),p=d.find(t.el,".vpreview-btn"),h=u.data;for(var g in h)h.hasOwnProperty(g)&&function(e,r){var i=d.create("i",{name:e,title:e});i.innerHTML=r,n.appendChild(i),d.on("click",i,function(e){var n=d.find(t.el,".veditor");E(n,r),y(n)})}(g,h[g]);t.emoji={show:function(){return t.preview.hide(),d.attr(i,"v",1),d.removeAttr(p,"v"),d.attr(n,"style","display:block"),t.emoji},hide:function(){return d.removeAttr(i,"v"),d.attr(n,"style","display:hide"),t.emoji}},t.preview={show:function(){return t.emoji.hide(),d.attr(p,"v",1),d.removeAttr(i,"v"),r.innerHTML=f.comment,d.attr(r,"style","display:block"),L(),t.preview},hide:function(){return d.removeAttr(p,"v"),d.attr(r,"style","display:none"),t.preview},empty:function(){return r.innerHtml="",t.preview}};var x=function(e){var t=d.create("div");t.insertAdjacentHTML("afterbegin",e);var n=d.findAll(t,"*"),r=["INPUT","STYLE","SCRIPT","IFRAME","FRAME","AUDIO","VIDEO","EMBED","META","TITLE","LINK"],i=function(e,t){var n=d.attr(e,t);n&&d.attr(e,t,n.replace(/(javascript|eval)/gi,""))};return d.each(n,function(e,n){1===n.nodeType&&(r.indexOf(n.nodeName)>-1&&("INPUT"===n.nodeName&&"checkbox"===d.attr(n,"type")?d.attr(n,"disabled","disabled"):d.remove(t,n)),"A"===n.nodeName&&i(n,"href"),d.clearAttr(n))}),t.innerHTML},y=function(e){var t=e.value||"";if(t){s(e),t=u.parse(t),e.value=t;var n=x(a(t));f.comment=n,r.innerHTML=n}else s.destroy(e)};d.on("click",i,function(e){d.attr(i,"v")?t.emoji.hide():t.emoji.show()}),d.on("click",p,function(e){if(""!=f.comment){d.attr(p,"v")?t.preview.hide():t.preview.show()}});for(var k=e.meta,_={},A={veditor:"comment"},O=0,S=k.length;O
"+s(e.message+"",!0)+"";throw e}}var v={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:u,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,nptable:u,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)|(?!script|pre|style)[a-z][\\w-]*\\s*>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:u,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/,text:/^[^\n]+/};v._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,v._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,v.def=c(v.def).replace("label",v._label).replace("title",v._title).getRegex(),v.bullet=/(?:[*+-]|\d+\.)/,v.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,v.item=c(v.item,"gm").replace(/bull/g,v.bullet).getRegex(),v.list=c(v.list).replace(/bull/g,v.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+v.def.source+")").getRegex(),v._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",v._comment=//,v.html=c(v.html,"i").replace("comment",v._comment).replace("tag",v._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),v.paragraph=c(v.paragraph).replace("hr",v.hr).replace("heading",v.heading).replace("lheading",v.lheading).replace("tag",v._tag).getRegex(),v.blockquote=c(v.blockquote).replace("paragraph",v.paragraph).getRegex(),v.normal=p({},v),v.gfm=p({},v.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),v.gfm.paragraph=c(v.paragraph).replace("(?!","(?!"+v.gfm.fences.source.replace("\\1","\\2")+"|"+v.list.source.replace("\\1","\\3")+"|").getRegex(),v.tables=p({},v.gfm,{nptable:/^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,table:/^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/}),v.pedantic=p({},v.normal,{html:c("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|
'+(n?e:s(e,!0))+"\n":""+(n?e:s(e,!0))+""},i.prototype.blockquote=function(e){return"\n"+e+"\n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return this.options.headerIds?"
"+e+"
\n"},i.prototype.table=function(e,t){return t&&(t=""+t+""),""+e+""},i.prototype.br=function(){return this.options.xhtml?"