This commit is contained in:
MHuiG 2020-04-10 16:06:54 +08:00
parent 43738d5335
commit 92b24d4a2b
2 changed files with 9 additions and 9 deletions

View File

@ -82,7 +82,7 @@
<%- partial('post/gitalk') %> <%- partial('post/gitalk') %>
<% } %> <% } %>
<% if (is_post()) { %> <% if (theme.minivaline && theme.minivaline.enable && !post.no_minivaline){ %>
<%- partial('post/minivaline') %> <%- partial('post/minivaline') %>
<% } %> <% } %>

View File

@ -1,13 +1,13 @@
<% if (!index && theme.leancloud && theme.leancloud.enable){ %> <% if (!index && theme.leancloud && theme.leancloud.enable){ %>
<!-- minivaline评论 --> <!-- minivaline评论 -->
<div id="vcomments-box"> <div id="mvcomments-box">
<div id="vcomments"> <div id="mvcomments">
</div> </div>
</div> </div>
<script src='https://unpkg.com/minivaline/dist/MiniValine.min.js'></script> <script src='https://cdn.jsdelivr.net/npm/minivaline/dist/MiniValine.min.js'></script>
<script> <script>
new MiniValine({ new MiniValine({
el: '#vcomments', el: '#mvcomments',
appId: '<%- theme.leancloud.app_id %>', appId: '<%- theme.leancloud.app_id %>',
appKey: '<%- theme.leancloud.app_key %>', appKey: '<%- theme.leancloud.app_key %>',
placeholder: '<%- theme.minivaline.placeholder %>', placeholder: '<%- theme.minivaline.placeholder %>',
@ -16,7 +16,7 @@
math: <%- theme.minivaline.math %>, math: <%- theme.minivaline.math %>,
md: <%- theme.minivaline.md %> md: <%- theme.minivaline.md %>
}); });
const infoEle = document.querySelector('#vcomments .info'); const infoEle = document.querySelector('#mvcomments .info');
if (infoEle && infoEle.childNodes && infoEle.childNodes.length > 0) { if (infoEle && infoEle.childNodes && infoEle.childNodes.length > 0) {
infoEle.childNodes.forEach(function (item) { infoEle.childNodes.forEach(function (item) {
item.parentNode.removeChild(item); item.parentNode.removeChild(item);
@ -24,17 +24,17 @@
} }
</script> </script>
<style> <style>
#vcomments-box { #mvcomments-box {
padding: 5px 30px; padding: 5px 30px;
} }
@media screen and (max-width: 800px) { @media screen and (max-width: 800px) {
#vcomments-box { #mvcomments-box {
padding: 5px 0px; padding: 5px 0px;
} }
} }
#vcomments-box #vcomments { #mvcomments-box #mvcomments {
background-color: #fff; background-color: #fff;
} }