hexo/themes/Klise/layout/partials/_comments/waline.ejs

26 lines
975 B
Plaintext
Raw Normal View History

2023-09-25 15:58:56 +08:00
<% if (theme.comments.button && page.comment && theme.waline.serverURL){ %>
<script src='//cdn.jsdelivr.net/npm/@waline/client/dist/Waline.min.js'></script>
<div id="waline"></div>
<script>
window.onload = function () {
var loadWaline = function () {
new Waline({
el: '#waline',
path: location.pathname,
avatarCDN: '<%=theme.waline.avatarCDN%>',
serverURL: '<%=theme.waline.serverURL %>',
avatar: '<%=theme.waline.avatar%>',
placeholder: "<%= theme.waline.placeholder %>"
});
}
if (<%- theme.comments.button %>) {
document.getElementById("comments-btn").onclick=function(){
document.getElementById("comments-btn").style.display="none";
loadWaline();
}} else {
loadWaline();
}
};
</script>
<% } %>