Skip to content

add valine comment system - #25

Merged
Ben02 merged 2 commits into
Ben02:masterfrom
xCss:master
Nov 18, 2017
Merged

Ben02 merged 2 commits into
Ben02:masterfrom
xCss:master

Conversation

@xCss

@xCss xCss commented Oct 25, 2017

Copy link
Copy Markdown
Contributor

add valine comment system.

_config.sample.yml

# Valine comments https://valine.js.org
valine:
  enable: false # if you want use valine, please set enable: true
  appid:  # your leancloud appid
  appkey:  # your leancloud appkey
  notify: false # true/false:mail notify !!!Test,Caution. https://github.com/xCss/Valine/wiki/Valine-%E8%AF%84%E8%AE%BA%E7%B3%BB%E7%BB%9F%E4%B8%AD%E7%9A%84%E9%82%AE%E4%BB%B6%E6%8F%90%E9%86%92%E8%AE%BE%E7%BD%AE
  verify: false # true/false:verify code
  avatar: mm # avatar style https://github.com/xCss/Valine/wiki/avatar-setting-for-valine
  placeholder: Just go go # comment box placeholder

layout/partial/comments.jade

if theme.valine.enable == true
    a#comments
    #vcomments(style="margin:0 30px;")
    script(src='//cdn1.lncld.net/static/js/3.0.4/av-min.js')
    script(src='//cdn.jsdelivr.net/gh/xcss/valine@v1.1.7/dist/Valine.min.js' + '?v=' + theme.version)
    script.
      var valine = new Valine({
        el:'#vcomments',
        notify:#{theme.valine.notify} || false, 
        verify:#{theme.valine.verify}|| false, 
        app_id:'#{theme.valine.appid}',
        app_key:'#{theme.valine.appkey}',
        placeholder:'#{theme.valine.placeholder}',
        path: window.location.pathname,
        avatar:'#{theme.valine.avatar}'
      })

Preview

@Ben02
Ben02 merged commit 7fa8df4 into Ben02:master Nov 18, 2017
@fyu0h

fyu0h commented Jun 6, 2019

Copy link
Copy Markdown

同样的配置在next下能够正常使用,但是在anatole下就不行。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants