forked from alshedivat/al-folio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
giscus.liquid
32 lines (31 loc) · 1.56 KB
/
giscus.liquid
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<div id="giscus_thread" style="max-width: {{ site.max_width }}; margin: 0 auto;">
{% if site.giscus.repo %}
<script>
let giscusTheme = determineComputedTheme();
let giscusAttributes = {
src: 'https://giscus.app/client.js',
'data-repo': '{{ site.giscus.repo }}',
'data-repo-id': '{{ site.giscus.repo_id }}',
'data-category': '{{ site.giscus.category }}',
'data-category-id': '{{ site.giscus.category_id }}',
'data-mapping': '{{ site.giscus.mapping }}',
'data-strict': '{{ site.giscus.strict }}',
'data-reactions-enabled': '{{ site.giscus.reactions_enabled }}',
'data-emit-metadata': '{{ site.giscus.emit_metadata }}',
'data-input-position': '{{ site.giscus.input_position }}',
'data-theme': giscusTheme,
'data-lang': '{{ site.giscus.lang }}',
crossorigin: 'anonymous',
async: '',
};
let giscusScript = document.createElement('script');
Object.entries(giscusAttributes).forEach(([key, value]) => giscusScript.setAttribute(key, value));
document.getElementById('giscus_thread').appendChild(giscusScript);
</script>
<noscript>Please enable JavaScript to view the <a href="http://giscus.app/?ref_noscript">comments powered by giscus.</a></noscript>
{% else %}
{% capture giscus_warning %} > ##### giscus comments misconfigured > Please follow instructions at
[http://giscus.app](http://giscus.app) and update your giscus configuration. {: .block-danger } {% endcapture %}
{{ giscus_warning | markdownify }}
{% endif %}
</div>