laozhu / hugo-nuo

🎨 A responsive light & clean hugo theme for blogger.
https://laozhu.me
MIT License
426 stars 150 forks source link

add gitalk as comment #104

Closed mohuishou closed 5 years ago

mohuishou commented 5 years ago

example config

  gitalkShow = true
  gitalkClientID = "GitHub Application Client ID"
  gitalkClientSecret = "GitHub Application Client Secret"
  gitalkRepo = "GitHub repo"
  gitalkOwner = 'GitHub repo owner'
  gitalkAdmin = ['GitHub repo owner and collaborators, only these guys can initialize github issues']

example: https://lailin.xyz

laozhu commented 5 years ago

Hi, @mohuishou, thanks for your great PR!

This theme will support more comment systems some days later, so I want to add a new field comments which makes it more scalable.

Now the supported options are disqus, gitalk, changyan and gitment. So I hope that you can change your code and do a new PR.

# Supported opitons: disqus, changyan, gitment, gitalk
comments = "gitalk"

# Gitalk
gitalkClientID = "GitHub Application Client ID"
gitalkClientSecret = "GitHub Application Client Secret"
gitalkRepo = "GitHub repo"
gitalkOwner = 'GitHub repo owner'
gitalkAdmin = ['GitHub repo owner and collaborators, only these guys can initialize github issues']

# Changyan (China Only)
# changyanId = "cyt3toRiB"
# changyanConf = "prod_0908b1cb9a581501753cce1ed074dbe3"

Make every comment system as a partial template, then switch comment system based on .Site.Params.comments field in the single.html template. BTW:

mohuishou commented 5 years ago

ok,waiting for your code updated