少女
140 字
1 分钟
Hexo ParticleX添加Valine评论
2024-01-21
  1. 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>
<% } %>
  1. themes\particlex\layout\post.ejs的倒数第三行开始加入以下代码:

    <% if (theme.valine.enable) { %>
    <div id="comment">
        <div id="vcomments"></div>
    </div>
    <% } %>
    
  2. 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评论/
作者
オナニー少女
发布于
2024-01-21
许可协议
CC BY-NC-SA 4.0