commit b5cb72cdb4285e454a06d048a0505c484c3e2a33 parent 3b88bbf78b8977d770f90785573368ecd51e6e91 Author: Yohanes Bandung Bondowoso <hi@ybbond.id> Date: Sat, 6 Feb 2021 13:38:27 +0700 feature: add comment by remarkbox Diffstat:
| M | layouts/_default/single.html | | | 6 | ++++-- |
| M | layouts/partials/head/auth-links.html | | | 4 | +++- |
| A | layouts/partials/post/remarkbox.html | | | 41 | +++++++++++++++++++++++++++++++++++++++++ |
3 files changed, 48 insertions(+), 3 deletions(-)
diff --git a/layouts/_default/single.html b/layouts/_default/single.html @@ -43,16 +43,18 @@ {{ end }} </p> {{ if ne .Type "page" -}} + <p class="hcard-bottom">If you have any feedback, please comment below or contact me at <a title="Open default mail client and add my email as recipient" href="mailto:hi@ybbond.id">hi@ybbond.id</a></p> {{- if isset .Params.Twitter "link" }} - <p class="twitter-link"><strong>Comment is unavailable for now</strong>, sorry :( You can reply this tweet, that will be linked to this post: <a target="_blank" rel="nofollow noreferrer" href={{ .Params.Twitter.Link }}>»Twitter Link« <i class="fab fa-twitter"></i></a></p> + <p class="twitter-link">You can also reply this tweet, that will be linked to this post: <a target="_blank" rel="nofollow noreferrer" href={{ .Params.Twitter.Link }}>»Twitter Link« <i class="fab fa-twitter"></i></a></p> {{ if isset .Params.Mastodon "link" -}} <p class="mastodon-link">If you prefer fediverse, you can reply this Toot instead: <a target="_blank" rel="nofollow noreferrer" href={{ .Params.Mastodon.Link }}>»Mastodon Link«</a></p> {{ end -}} {{- end }} - <p class="hcard-bottom">If you have any feedback, please contact me at <a title="Open default mail client and add my email as recipient" href="mailto:hi@ybbond.id">hi@ybbond.id</a></p> {{ end -}} </div> + {{ partial "post/remarkbox.html" . }} + {{- if ne .Type "page" }} {{ partial "post/webmentions-handler.html" . }} {{- else }} diff --git a/layouts/partials/head/auth-links.html b/layouts/partials/head/auth-links.html @@ -1,10 +1,12 @@ <link rel="webmention" href="https://webmention.io/ybbond.id/webmention" /> <link rel="pingback" href="https://webmention.io/ybbond.id/xmlrpc" /> +<!-- <link rel="authorization_endpoint" href="https://indieauth.com/auth"> <link rel="token_endpoint" href="https://tokens.indieauth.com/token"> +--> -<link rel="microsub" href="https://aperture.p3k.io/microsub/522"> +<link rel="microsub" href="https://aperture.p3k.io/microsub/603"> <link data-hint="Twitter" title="Twitter" href="https://twitter.com/{{ .Site.Params.Twitter }}" rel="me" /> <link data-hint="GitHub" title="GitHub" href="https://github.com/{{ .Site.Params.Github }}" rel="me" /> diff --git a/layouts/partials/post/remarkbox.html b/layouts/partials/post/remarkbox.html @@ -0,0 +1,41 @@ +<!-- 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 = "372c6a71-6844-11eb-8f74-040140774501"; + var thread_uri = window.location.href; + var thread_title = window.document.title; + var thread_fragment = window.location.hash; + + // rb owner was here. + var rb_src = "https://my.remarkbox.com/embed" + + "?rb_owner_key=" + rb_owner_key + + "&thread_title=" + encodeURI(thread_title) + + "&thread_uri=" + encodeURIComponent(thread_uri) + + thread_fragment; + + function create_remarkbox_iframe() { + var ifrm = document.createElement("iframe"); + ifrm.setAttribute("id", "remarkbox-iframe"); + ifrm.setAttribute("scrolling", "no"); + ifrm.setAttribute("src", rb_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>