mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 11:16:31 -05:00
d939de17df
This commit should fix existing problems with Disqus and Google Analytics enabled in the meta-yaml section of a note. Before this commit they were blocked by the strict CSP. It's still possible to disable the added directives using `addDisqus` and `addGoogleAnalytics` in the `csp` config section. They are enabled by default to prevent breaking changes. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
13 lines
541 B
Text
13 lines
541 B
Text
<div id="disqus_thread"></div>
|
|
<script nonce="<%= cspNonce %>">
|
|
var disqus_config = function () {
|
|
this.page.identifier = window.location.pathname.split('/').slice(-1)[0];
|
|
};
|
|
(function() {
|
|
var d = document, s = d.createElement('script');
|
|
s.src = 'https://<%= disqus %>.disqus.com/embed.js';
|
|
s.setAttribute('data-timestamp', +new Date());
|
|
(d.head || d.body).appendChild(s);
|
|
})();
|
|
</script>
|
|
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|