Commit 127c2801 authored by Kaushal Modi's avatar Kaushal Modi

Add support for Remarkbox comments

parent 4eaa2253
......@@ -35,20 +35,27 @@
{{/* printf "%#v" $.Site */}}
{{/* printf "%#v" $.Site.Params */}}
{{ with .Site.Params.isso }}
{{ with .Site.Params.remarkbox }}
<div class="comments clear-float">
<h2>Comments</h2>
{{ partial "isso.html" . }}
{{ partial "remarkbox.html" . }}
</div>
{{/* else if not (eq .Site.DisqusShortname "") */}}
<!-- Below works the same way as the above empty-string equality check -->
{{ else }}
{{ with .Site.DisqusShortname }}
{{ with .Site.Params.isso }}
<div class="comments clear-float">
<h2>Comments</h2>
{{/* template "_internal/disqus.html" . */}}
{{ partial "disqus.html" . }}
{{ partial "isso.html" . }}
</div>
{{/* else if not (eq .Site.DisqusShortname "") */}}
<!-- Below works the same way as the above empty-string equality check -->
{{ else }}
{{ with .Site.DisqusShortname }}
<div class="comments clear-float">
<h2>Comments</h2>
{{/* template "_internal/disqus.html" . */}}
{{ partial "disqus.html" . }}
</div>
{{ end }}
{{ end }}
{{ end }}
......
<!-- Remarkbox - Your readers want to communicate with you -->
<div id="remarkbox-div">
<noscript>
<iframe id=remarkbox-iframe src="https://my.remarkbox.com/embed?nojs=true" style="height:600px;width:100%;border:none!important" tabindex=0></iframe>
</noscript>
</div>
<script src="https://my.remarkbox.com/static/js/iframe-resizer/iframeResizer.min.js"></script>
<script>
var rb_owner_key = "{{ .owner_key }}";
var thread_uri = window.location.href;
var thread_fragment = window.location.hash;
function create_remarkbox_iframe() {
var src = "https://my.remarkbox.com/embed?rb_owner_key=" + rb_owner_key + "&thread_uri=" + thread_uri;
var ifrm = document.createElement("iframe");
ifrm.setAttribute("id", "remarkbox-iframe");
ifrm.setAttribute("scrolling", "no");
ifrm.setAttribute("src", src);
ifrm.setAttribute("frameborder", "0");
ifrm.setAttribute("tabindex", "0");
ifrm.setAttribute("title", "Remarkbox");
ifrm.style.width = "100%";
document.getElementById("remarkbox-div").appendChild(ifrm);
}
create_remarkbox_iframe();
iFrameResize(
{
checkOrigin: ["https://my.remarkbox.com"],
inPageLinks: true,
initCallback: function(e) {e.iFrameResizer.moveToAnchor(thread_fragment)}
},
document.getElementById("remarkbox-iframe")
);
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment