This commit is contained in:
parent
2537e4d5af
commit
7d58c330a6
1 changed files with 9 additions and 24 deletions
|
|
@ -1,28 +1,13 @@
|
||||||
{% if page.meta.comments %}
|
{% if page.meta.comments %}
|
||||||
<h2 id="__comments">{{ lang.t("meta.comments") }}</h2>
|
<h2 id="__comments">{{ lang.t("meta.comments") }}</h2>
|
||||||
<div id="cusdis_thread"></div>
|
<div id="cusdis_thread"
|
||||||
<script>
|
data-host="{{ config.extra.cusdis.host }}"
|
||||||
(function() {
|
data-app-id="{{ config.extra.cusdis.app_id }}"
|
||||||
var host = "{{ config.extra.cusdis.host }}";
|
data-page-id="{{ page.canonical_url }}"
|
||||||
var appId = "{{ config.extra.cusdis.app_id }}";
|
data-page-url="{{ page.canonical_url }}"
|
||||||
var pageId = "{{ page.canonical_url }}";
|
data-page-title="{{ page.title }}"
|
||||||
var pageUrl = "{{ page.canonical_url }}";
|
data-theme="auto">
|
||||||
var pageTitle = "{{ page.title }}";
|
</div>
|
||||||
var theme = "auto";
|
<script async defer src="{{ config.extra.cusdis.host }}/js/cusdis.es.js"></script>
|
||||||
|
|
||||||
var iframe = document.createElement("iframe");
|
|
||||||
iframe.src = host + "/iframe/thread"
|
|
||||||
+ "?app_id=" + encodeURIComponent(appId)
|
|
||||||
+ "&page_id=" + encodeURIComponent(pageId)
|
|
||||||
+ "&page_url=" + encodeURIComponent(pageUrl)
|
|
||||||
+ "&page_title=" + encodeURIComponent(pageTitle)
|
|
||||||
+ "&theme=" + theme;
|
|
||||||
iframe.style.cssText = "width:100%;border:none;min-height:300px";
|
|
||||||
iframe.title = "Comments";
|
|
||||||
|
|
||||||
var container = document.getElementById("cusdis_thread");
|
|
||||||
if (container) container.appendChild(iframe);
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
<noscript>Please enable JavaScript to view the comments.</noscript>
|
<noscript>Please enable JavaScript to view the comments.</noscript>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
Loading…
Reference in a new issue