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 comments system #14

Merged
merged 1 commit into from Oct 25, 2017

Conversation

Projects
None yet
2 participants
@xCss
Contributor

xCss commented Oct 25, 2017

add valine comments system.

_config.yml:

# Valine comments https://valine.js.org
valine:
    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.ejs:

<% if(page.comments && theme.comments && theme.comments.valine && theme.comments.valine.appid && theme.comments.valine.appkey ){ %>
    <hr />
    <h3><%- __('comment')%>:</h3>
    <div id="valine"></div>
    <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
    <script src='//unpkg.com/valine@1.1.7/dist/Valine.min.js'></script>
    <script>
    new Valine({
        el: '#valine' ,
        notify:<%= theme.comments.valine.notify %>,
        verify:<%= theme.comments.valine.verify %>,
        app_id: '<%= theme.comments.valine.appid %>',
        app_key: '<%= theme.comments.valine.appkey %>',
        placeholder: '<%= theme.comments.valine.placeholder %>',
        path:window.location.pathname,
        avatar:'<%= theme.comments.valine.avatar %>' 
    });
    </script>
<% } %>

Preview

@klugjo klugjo merged commit a61d2f3 into klugjo:master Oct 25, 2017

@klugjo

This comment has been minimized.

Owner

klugjo commented Oct 25, 2017

谢谢

@xCss

This comment has been minimized.

Contributor

xCss commented Oct 25, 2017

😄 客气~

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