Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/leonhe/hugo_eiio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuanfei He <lhe868@gmail.com>2020-07-12 17:54:47 +0300
committerYuanfei He <lhe868@gmail.com>2020-07-12 17:54:47 +0300
commit380db6ee93f924d456de5ee27c9c022ce6132357 (patch)
treeb3ae2e5492f94dc3e65ba0798731656e65355839
parenteddf026bc60e9aa95d0e3b897afdb90f4a3dd7ff (diff)
:art: add remark42 commentfeature/comment
-rw-r--r--layouts/_default/single.html47
1 files changed, 47 insertions, 0 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 2360a2c..3d8b3c8 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -56,9 +56,56 @@
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
+<script>
+ var remark_config = {
+ host: "https://game.hii8.com", // hostname of remark server, same as REMARK_URL in backend config, e.g. "https://demo.remark42.com"
+ site_id: 'hii8',
+ components: ['embed'], // optional param; which components to load. default to ["embed"]
+ // to load all components define components as ['embed', 'last-comments', 'counter']
+ // available component are:
+ // - 'embed': basic comments widget
+ // - 'last-comments': last comments widget, see `Last Comments` section below
+ // - 'counter': counter widget, see `Counter` section below
+ url: '{{ .Permalink}}', // optional param; if it isn't defined
+ // `window.location.origin + window.location.pathname` will be used,
+ //
+ // Note that if you use query parameters as significant part of url
+ // (the one that actually changes content on page)
+ // you will have to configure url manually to keep query params, as
+ // `window.location.origin + window.location.pathname` doesn't contain query params and
+ // hash. For example default url for `https://example/com/example-post?id=1#hash`
+ // would be `https://example/com/example-post`.
+ //
+ // The problem with query params is that they often contain useless params added by
+ // various trackers (utm params) and doesn't have defined order, so Remark treats differently
+ // all this examples:
+ // https://example.com/?postid=1&date=2007-02-11
+ // https://example.com/?date=2007-02-11&postid=1
+ // https://example.com/?date=2007-02-11&postid=1&utm_source=google
+ //
+ // If you deal with query parameters make sure you pass only significant part of it
+ // in well defined order
+ max_shown_comments: 10, // optional param; if it isn't defined default value (15) will be used
+ theme: 'light', // optional param; if it isn't defined default value ('light') will be used
+ page_title: 'Moving to Remark42', // optional param; if it isn't defined `document.title` will be used
+ locale: 'zh' // set up locale and language, if it isn't defined default value ('en') will be used
+ };
+
+ (function(c) {
+ for(var i = 0; i < c.length; i++){
+ var d = document, s = d.createElement('script');
+ s.src = remark_config.host + '/web/' +c[i] +'.js';
+ s.defer = true;
+ (d.head || d.body).appendChild(s);
+ }
+ })(remark_config.components || ['embed']);
+</script>
+<div id="remark42"></div>
+
{{ if .Site.DisqusShortname }}
{{ template "_internal/disqus.html" . }}
{{ end }}
+
{{ if .Site.Params.hasCommento }}
<div id="commento"></div>
<script src="https://cdn.commento.io/js/commento.js"></script>