140 字
1 分钟
Hexo ParticleX添加Valine评论
- 在
themes\particlex\layout\comment.ejs
的最后添加以下代码:(可使用CDN)
<% if (theme.valine.enable) { %>
<script src="https://cdn.bootcdn.net/ajax/libs/valine/1.5.1/Valine.min.js"></script>
<script>
new Valine({
// 请使用你自己的设置
el: '#vcomments',
appId: '<%- theme.valine.appId %>',
appKey: '<%- theme.valine.appKey %>',
avatar: 'mp',
path: window.location.pathname,
serverURLs: '<%- theme.valine.serverURLs %>',
});
</script>
<% } %>
从
themes\particlex\layout\post.ejs
的倒数第三行开始加入以下代码:<% if (theme.valine.enable) { %> <div id="comment"> <div id="vcomments"></div> </div> <% } %>
在
themes\particlex\_config.yml
加入Valine的配置项# Valine valine: enable: true appId: # 你的appId appKey: # 你的appKey serverURLs: # 你的serverURLs
所以ParticleX为什么不支持Valine 高亮好像不支持ejs所以代码块上写的html
Hexo ParticleX添加Valine评论
https://onaniishoujo.github.io/posts/hexo-particlex添加valine评论/