diff options
author | kissshot <k@03k.org> | 2018-11-06 13:34:08 +0300 |
---|---|---|
committer | Chen Xianmin <xianmin12@gmail.com> | 2018-11-06 13:34:08 +0300 |
commit | 20ffe4e5223f31579378d8754adf6af5bee069cb (patch) | |
tree | 3e2f32a0d05b158cc93a2070ea4df4ebdf8cf153 | |
parent | 55de7951249eff5ea084dbd7c79f0714c09b7400 (diff) |
feat: Add LiveRe comments (#139)
-rw-r--r-- | exampleSite/full-config.toml | 5 | ||||
-rw-r--r-- | layouts/partials/comments.html | 21 | ||||
-rw-r--r-- | layouts/partials/scripts.html | 2 |
3 files changed, 26 insertions, 2 deletions
diff --git a/exampleSite/full-config.toml b/exampleSite/full-config.toml index 25402c5..2f7738f 100644 --- a/exampleSite/full-config.toml +++ b/exampleSite/full-config.toml @@ -130,7 +130,10 @@ defaultContentLanguage = "en" # Default language to use repo = "" # The repo to store comments clientId = "" # Your client ID clientSecret = "" # Your client secret - + + [params.livere] #LiveRe comment. see https://www.livere.com/ + uid = "" + [params.reward] # 文章打赏 enable = false wechat = "/path/to/your/wechat-qr-code.png" # 微信二维码 diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html index 23de5d2..f221c91 100644 --- a/layouts/partials/comments.html +++ b/layouts/partials/comments.html @@ -87,4 +87,25 @@ <!-- <a href="http://disqus.com/" class="dsq-brlink" target="_blank">comments powered by <span class="logo-disqus">Disqus</span></a> --> </div> {{- end }} + + <!-- LiveRe --> + {{- if .Site.Params.livere.uid -}} + <div id="lv-container" class="disqus-comment" data-id="city" data-uid='{{ .Site.Params.livere.uid }}'> + <script type="text/javascript"> + (function(d, s) { + var j, e = d.getElementsByTagName(s)[0]; + if (typeof LivereTower === 'function') { return; } + j = d.createElement(s); + j.src = 'https://cdn-city.livere.com/js/embed.dist.js'; + j.async = true; + e.parentNode.insertBefore(j, e); + })(document, 'script'); + </script> + <noscript>Please enable JavaScript to view the + <a href="https://www.livere.com">comments powered by LiveRe.</a> + </div> + {{- end }} + {{- end }} + + diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index 163e7c3..b7a71e4 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -72,7 +72,7 @@ <!-- Load PhotoSwipe js if the load-photoswipe shortcode has been used --> {{ if or .Site.Params.photoswipe .Site.Params.fancybox }} {{ if .Site.Params.bootcdn }} - <script src="{{ " /js/load-photoswipe.js " | relURL }}"></script> + <script src="{{ "/js/load-photoswipe.js" | relURL }}"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.1/photoswipe.min.js" integrity="sha256-UplRCs9v4KXVJvVY+p+RSo5Q4ilAUXh7kpjyIP5odyc=" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.1/photoswipe-ui-default.min.js" integrity="sha256-PWHOlUzc96pMc8ThwRIXPn8yH4NOLu42RQ0b9SpnpFk=" |