diff options
author | Emily <734204679@qq.com> | 2021-10-28 18:11:25 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-28 18:11:25 +0300 |
commit | 098179ec1ffd0bd9408d145123f0338346e9fa28 (patch) | |
tree | fed996af5c9464139d5c060e5949dca2745c13b4 /layouts/partials | |
parent | ff86f78b4ddcfe26991f16506e04b28a14a9e93a (diff) |
Add valine comment system support (#446)
* feat: add valine support
* Adjust the comment config
* Adjust the comment config
* Make comment section backward compatible with old config
Signed-off-by: hossainemruz <hossainemruz@gmail.com>
Co-authored-by: hossainemruz <hossainemruz@gmail.com>
Diffstat (limited to 'layouts/partials')
-rw-r--r-- | layouts/partials/disqus.html | 7 | ||||
-rw-r--r-- | layouts/partials/valine.html | 17 |
2 files changed, 23 insertions, 1 deletions
diff --git a/layouts/partials/disqus.html b/layouts/partials/disqus.html index 71fef21..4ccd9e2 100644 --- a/layouts/partials/disqus.html +++ b/layouts/partials/disqus.html @@ -1,3 +1,8 @@ +{{ $disqusShortName := site.DisqusShortname }} +{{ if site.Params.features.disqus.shortName }} + {{ $disqusShortName = site.Params.features.disqus.shortName }} +{{ end }} + <div id="disqus_thread"></div> <script type="text/javascript"> (function () { @@ -8,7 +13,7 @@ var dsq = document.createElement("script"); dsq.type = "text/javascript"; dsq.async = true; - var disqus_shortname = "{{ site.DisqusShortname }}"; + var disqus_shortname = "{{ $disqusShortName }}"; dsq.src = "//" + disqus_shortname + ".disqus.com/embed.js"; ( document.getElementsByTagName("head")[0] || diff --git a/layouts/partials/valine.html b/layouts/partials/valine.html new file mode 100644 index 0000000..c72e28a --- /dev/null +++ b/layouts/partials/valine.html @@ -0,0 +1,17 @@ +<!-- valine --> +<div id="vcomments"></div> +<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script> +<script src="//unpkg.com/valine/dist/Valine.min.js"></script> +<script type="text/javascript"> + new Valine({ + el: "#vcomments", + appId: "{{ .valine.appId }}", + appKey: "{{ .valine.appKey }}", + avatar: "{{ .valine.avatar }}", + placeholder: "{{ .valine.placeholder }}", + visitor: "{{ .valine.visitor }}", + lang: "{{ .valine.lang }}", + recordIP: "{{ .valine.recordIP }}", + enableQQ: "{{ .valine.enableQQ }}", + }); +</script> |