hexo-theme-ayer/layout/_partial/post/minivaline.ejs
2020-06-07 10:10:49 +08:00

49 lines
1.2 KiB
Plaintext

<% if (!index && theme.leancloud && theme.leancloud.enable){ %>
<!-- minivaline评论 -->
<div id="mvcomments-box">
<div id="mvcomments"></div>
</div>
<script src="https://cdn.jsdelivr.net/npm/minivaline@2/dist/MiniValine.min.js"></script>
<script>
new MiniValine({
el: '#mvcomments',
appId: '<%- theme.leancloud.app_id %>',
appKey: '<%- theme.leancloud.app_key %>',
placeholder: '<%- theme.minivaline.placeholder %>',
lang: '<%- theme.minivaline.lang %>',
adminEmailMd5: '<%- theme.minivaline.adminEmailMd5 %>',
math: <%- theme.minivaline.math %>,
md: <%- theme.minivaline.md %>
});
const infoEle = document.querySelector('#mvcomments .info');
if (infoEle && infoEle.childNodes && infoEle.childNodes.length > 0) {
infoEle.childNodes.forEach(function (item) {
item.parentNode.removeChild(item);
});
}
</script>
<style>
#mvcomments-box {
padding: 5px 30px;
}
@media screen and (max-width: 800px) {
#mvcomments-box {
padding: 5px 0px;
}
}
#mvcomments-box #mvcomments {
background-color: #fff;
}
.v .vlist .vcard .vh {
padding-right: 20px;
}
.v .vlist .vcard {
padding-left: 10px;
}
</style>
<% } %>