Skip to content

Instantly share code, notes, and snippets.

@verlane
Created August 16, 2013 00:31
Show Gist options
  • Save verlane/6246230 to your computer and use it in GitHub Desktop.
Save verlane/6246230 to your computer and use it in GitHub Desktop.
로컬에서 Disqus 댓글 입력창 비표시
diff --git a/source/_includes/disqus.html b/source/_includes/disqus.html
index 10565e8..905b4a9 100644
--- a/source/_includes/disqus.html
+++ b/source/_includes/disqus.html
@@ -12,10 +12,13 @@
{% comment %} As `page.comments` is empty, we must be on the index page. {% endcomment %}
var disqus_script = 'count.js';
{% endif %}
- (function () {
- var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
- dsq.src = '//go.disqus.com/' + disqus_script;
- (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
- }());
+
+ if ($(location).attr("hostname") != "localhost") {
+ (function () {
+ var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
+ dsq.src = '//go.disqus.com/' + disqus_script;
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
+ }());
+ }
</script>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment