New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add valine comment system #25

Merged
merged 2 commits into from Nov 18, 2017

Conversation

Projects
None yet
2 participants
@xCss
Contributor

xCss commented Oct 25, 2017

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

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