Add Facebook Comment System

This commit is contained in:
realsangil 2020-01-04 11:25:34 +09:00
parent b556dfccc8
commit 89cb24cf19
3 changed files with 27 additions and 0 deletions

View file

@ -78,6 +78,7 @@ I hope you will LoveIt ❤️!
* Disqus comment system support by [Disqus](https://disqus.com) * Disqus comment system support by [Disqus](https://disqus.com)
* Gitalk comment system support by [Gitalk](https://github.com/gitalk/gitalk) * Gitalk comment system support by [Gitalk](https://github.com/gitalk/gitalk)
* Valine comment system support by [Valine](https://valine.js.org/) * Valine comment system support by [Valine](https://valine.js.org/)
* Facebook comment system support by [Facebook](https://developers.facebook.com/docs/plugins/comments/)
### Extended Features ### Extended Features
@ -207,6 +208,7 @@ Thanks to the authors of following resources included in the theme:
* [MetingJS](https://github.com/metowolf/MetingJS) * [MetingJS](https://github.com/metowolf/MetingJS)
* [Gitalk](https://github.com/gitalk/gitalk) * [Gitalk](https://github.com/gitalk/gitalk)
* [Valine](https://valine.js.org/) * [Valine](https://valine.js.org/)
* [Facebook](https://developers.facebook.com/docs/plugins/comments/)
## Author ## Author

View file

@ -221,6 +221,13 @@ staticDir = ["static", "../assets/others"] # static directories
placeholder = "Your comment ..." placeholder = "Your comment ..."
visitor = true visitor = true
recordIP = true recordIP = true
[params.facebook] # Facebook Comment Config (https://developers.facebook.com/docs/plugins/comments)
enable = false
width = "100%"
numPosts = 10
appId = ""
languageCode = "en_US"
[privacy] #### Privacy Info (https://gohugo.io/about/hugo-and-gdpr/) [privacy] #### Privacy Info (https://gohugo.io/about/hugo-and-gdpr/)
[privacy.googleAnalytics] [privacy.googleAnalytics]

View file

@ -75,4 +75,22 @@
}); });
</script> </script>
{{- end -}} {{- end -}}
<!-- facebook comment -->
{{- if .Site.Params.facebook.enable -}}
{{ .Site.Params.baseURL }}{{ .Permalink | absURL }}
<div id="fb-root"></div>
<script
async
defer
crossorigin="anonymous"
src="https://connect.facebook.net/{{ .Site.Params.facebook.languageCode }}}/sdk.js#xfbml=1&version=v5.0&appId={{ .Site.Params.facebook.appId }}&autoLogAppEvents=1"
></script>
<div
class="fb-comments"
data-href="{{ .Site.Params.baseURL }}{{ .Permalink | absURL }}"
data-width="{{ .Site.Params.facebook.width }}"
data-numposts="{{ .Site.Params.facebook.numPosts }}"
></div>
{{- end -}}
{{- end }} {{- end }}