Hexo-theme-next: Question from Refactoring Comments PR

Created on 1 Apr 2019  Â·  14Comments  Â·  Source: theme-next/hexo-theme-next




PR #711.

Question Solved 📊 Polls

Most helpful comment

I try hexo.theme.setView, and it performed well.
See https://github.com/JiangTJ/hexo-theme-plus.
If this PR done, we can easy split different comment systems.
So those config keep the original and add only new configurations? Consider this in next refactoring?

GitHub
Contribute to JiangTJ/hexo-theme-plus development by creating an account on GitHub.

All 14 comments

Example for this polls

comment

comments:
  type: disqus
  count: 
    page: true
    post: true
# Additional Configurations.
# disqus:
#   shortname:
#   lazyload: false
# disqusjs:
#   api:
#   apikey: # register new application from https://disqus.com/api/applications/
#   shortname: # See: https://disqus.com/admin/settings/general/
...

uncomment

comments:
  type: disqus
  count: 
    page: true
    post: true
# Additional Configurations.
# none or some comment for disqus
disqus:
  shortname:
  lazyload: false
# none or some comment for disqusjs
disqusjs:
  api:
  apikey: # register new application from https://disqus.com/api/applications/
  shortname: # See: https://disqus.com/admin/settings/general/
...

remove

comments:
  type: disqus
  count: 
    page: true
    post: true
# No Additional Configurations describe.

I still have not voted...
And yes, uncommented will a little confusing users, I think.

uncommented will a little confusing users

Will be fixed after https://github.com/theme-next/hexo-theme-next/issues/703

uncommented will a little confusing users

Will be fixed after #703

After that we can place config templates for comments. For now it's ugly, I think.

uncommented will a little confusing users

If my example is error, help me to edit it.

Your example good, don't worry.

  1. Different comment systems' configuration are not exactly all the same;
  2. _config.yml itself should be self-explanatory enough, to be user-friendly; we can not rely on all the users would read the documentation.

As for additional configurations for each comment system, I've no idea whether it should be commented or not. At least, lines number remains the same.

Or we can deal with #703 first?

I try hexo.theme.setView, and it performed well.
See https://github.com/JiangTJ/hexo-theme-plus.
If this PR done, we can easy split different comment systems.
So those config keep the original and add only new configurations? Consider this in next refactoring?

GitHub
Contribute to JiangTJ/hexo-theme-plus development by creating an account on GitHub.

Can u provide some examples here? I'm a don't understand what u suggesting and seems #703 not relevant to considered by u.

@ivan-nginx
we can create a new repo include comment.swig index.swig and count.swig, and write a script like this:

hexo.extend.filter.register('before_generate', function (data) {
  hexo.theme.setView('_third-party/comments/new_comment_system/comment.swig', fs.read comment.swig file)
  hexo.theme.setView('_third-party/comments/new_comment_system/index.swig', fs.read index.swig file)
  hexo.theme.setView('_third-party/comments/new_comment_system/count.swig', fs.read count.swig file)
}

And then, if npm installed, new_comment_system would add to next.

And can it be finded automatically? Without new_comment_system defining. Otherwise we have to add any new comment system to this code. And this is suggesting to cut out comment systems from the NexT.

Another question is – configuration, which we discuss in this issue.Where will be placed configuration pieces for each comment system? Still in main config for NexT? Commented? Cutted out and added to each repo? When for each comment system we will read readme's of each repo for installation and for configuration? How about translate for this readme? Translate will be impossible or at least too hard (we cant't to join translate service like Crowdin to many repos).

And can it be finded automatically?

Yes, comments.type will find folder to included.

Where will be placed configuration pieces for each comment system?

I think it's better to show config in each comment system plugin repo. User can choose to install.

How about translate for this readme?

English is enough in readme. Of course, we need to write docs in theme-next.org. It can be translate to different language.

Seems the result has a draw. I will do it keep original. And only add new config.

We can discuss it in https://github.com/theme-next/hexo-theme-next/issues/703.

Was this page helpful?
0 / 5 - 0 ratings