giscus comments
[mdref/mdref] / views / comments.giscus.phtml
1 <?php if (isset($providerData->data)) : ?>
2 <style>.giscus-frame {min-height: 16em;}</style>
3 <script>
4 function giscus_load(button) {
5 let script = document.createElement("script");
6 <?php foreach ($providerData->data as $key => $val) : ?>
7 script.setAttribute("data-<?=$key?>", <?php var_export($val)?>);
8 <?php endforeach; ?>
9
10 script.src = "//giscus.app/client.js";
11 button.parentNode.replaceChild(script, button);
12 }
13 </script>
14 <button class="activator" onclick="giscus_load(this)">Show Comments from Github Discussions</button>
15 <?php endif; ?>