Skip to content
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

refactor(comment): split comment provider/allow custom #311

Merged
merged 3 commits into from
Apr 29, 2017

Conversation

cubesky
Copy link
Collaborator

@cubesky cubesky commented Apr 21, 2017

What kind of change does this PR introduce? (check one with "x")

  • Bug fix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

Description

Split Comment provider to single folder to avoid conflict with update.
Now everyone can custom their own comment provider easily.

How to Custom comment provider ?

  1. Create new folder in layout\_widget\comment\ .
  2. Create three new file with common.ejs enter.ejs main.ejs.
  3. Put codes in these file.
    • Insert common js file in common.ejs.
    • Setup div and main.ejs in enter.ejs.
    • Init comment provider in main.ejs
  4. Change your comment.use in _config.yml to the name of your custom folder.
  5. Enjoy!

You can also see disqus folder to learn more.

Tips:
You can create a comment.yml in your site root_folder/source/_data/ and use site.data.comment.xxxx to use them. Eg. comment.yml

comment_js: https://example.com/example.js

And use <%- site.data.comment.comment_js %> in your custom ejs files to use this.


Verification steps

Make your own custom comment provider following How to Custom comment provider ? and run hexo s

@neoFelhz neoFelhz merged commit 30ad8ea into canary Apr 29, 2017
@neoFelhz neoFelhz deleted the refactor/comment branch April 29, 2017 06:43
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.

None yet

3 participants