| | |
| | | <div id="gitalk-container"></div> |
| | | <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css"> |
| | | <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css" /> |
| | | <script src="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js"></script> |
| | | <script> |
| | | const gitalk = new Gitalk({ |
| | |
| | | owner: '{{ .Site.Params.Gitalk.owner }}', |
| | | admin: ['{{ .Site.Params.Gitalk.admin }}'], |
| | | id: location.pathname, // Ensure uniqueness and length less than 50 |
| | | distractionFreeMode: false // Facebook-like distraction free mode |
| | | distractionFreeMode: false, // Facebook-like distraction free mode |
| | | }); |
| | | (function() { |
| | | if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) { |
| | | document.getElementById('gitalk-container').innerHTML = 'Gitalk comments not available by default when the website is previewed locally.'; |
| | | (function () { |
| | | if (['localhost', '127.0.0.1'].indexOf(window.location.hostname) != -1) { |
| | | document.getElementById('gitalk-container').innerHTML = |
| | | 'Gitalk comments not available by default when the website is previewed locally.'; |
| | | return; |
| | | } |
| | | gitalk.render('gitalk-container'); |
| | | })(); |
| | | </script> |
| | | </script> |