Skip to content

Commit 7f7b81d

Browse files
committed
disqus
1 parent 5bf3743 commit 7f7b81d

File tree

9 files changed

+102
-115
lines changed

9 files changed

+102
-115
lines changed

layouts/partials/disqus.html

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
<div id="disqus_thread"></div>
2-
<script type="text/javascript">
3-
1+
<div id="disqus_thread" style="width:100vw"></div>
2+
<script type="application/javascript">
3+
window.disqus_config = function () {};
44
(function() {
55
// Don't ever inject Disqus on localhost--it creates unwanted
66
// discussions from 'localhost:1313' on your Disqus account...
7-
if (window.location.hostname == "localhost")
7+
if (["dfkjh"].indexOf(window.location.hostname) != -1) {
8+
document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
89
return;
9-
10-
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
11-
var disqus_shortname = '{{ .Site.DisqusShortname }}';
12-
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
13-
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
10+
}
11+
var d = document, s = d.createElement('script'); s.async = true;
12+
s.src = '//' + "singhcoder" + '.disqus.com/embed.js';
13+
s.setAttribute('data-timestamp', +new Date());
14+
(d.head || d.body).appendChild(s);
1415
})();
1516
</script>
1617
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>

layouts/partials/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{ template "_internal/disqus.html" . }}
1+
{{ template "partials/disqus.html" . }}
22

33
<footer class="footer">
44
<div class="footer-row">

public/categories/index.html

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -116,26 +116,24 @@ <h2>Tags</h2>
116116

117117
</div>
118118
</main>
119-
<div id="disqus_thread"></div>
119+
<div id="disqus_thread" style="width:100vw"></div>
120120
<script type="application/javascript">
121-
window.disqus_config = function () {
121+
window.disqus_config = function () {};
122+
(function() {
122123

123124

124-
125-
};
126-
(function() {
127-
if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) {
128-
document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
129-
return;
130-
}
131-
var d = document, s = d.createElement('script'); s.async = true;
132-
s.src = '//' + "singhcoder" + '.disqus.com/embed.js';
133-
s.setAttribute('data-timestamp', +new Date());
134-
(d.head || d.body).appendChild(s);
135-
})();
125+
if (["dfkjh"].indexOf(window.location.hostname) != -1) {
126+
document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
127+
return;
128+
}
129+
var d = document, s = d.createElement('script'); s.async = true;
130+
s.src = '//' + "singhcoder" + '.disqus.com/embed.js';
131+
s.setAttribute('data-timestamp', +new Date());
132+
(d.head || d.body).appendChild(s);
133+
})();
136134
</script>
137135
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
138-
<a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
136+
<a href="https://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
139137

140138
<footer class="footer">
141139
<div class="footer-row">

public/index.html

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -196,26 +196,24 @@ <h2>Tags</h2>
196196

197197
</div>
198198
</main>
199-
<div id="disqus_thread"></div>
199+
<div id="disqus_thread" style="width:100vw"></div>
200200
<script type="application/javascript">
201-
window.disqus_config = function () {
201+
window.disqus_config = function () {};
202+
(function() {
202203

203204

204-
205-
};
206-
(function() {
207-
if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) {
208-
document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
209-
return;
210-
}
211-
var d = document, s = d.createElement('script'); s.async = true;
212-
s.src = '//' + "singhcoder" + '.disqus.com/embed.js';
213-
s.setAttribute('data-timestamp', +new Date());
214-
(d.head || d.body).appendChild(s);
215-
})();
205+
if (["dfkjh"].indexOf(window.location.hostname) != -1) {
206+
document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
207+
return;
208+
}
209+
var d = document, s = d.createElement('script'); s.async = true;
210+
s.src = '//' + "singhcoder" + '.disqus.com/embed.js';
211+
s.setAttribute('data-timestamp', +new Date());
212+
(d.head || d.body).appendChild(s);
213+
})();
216214
</script>
217215
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
218-
<a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
216+
<a href="https://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
219217

220218
<footer class="footer">
221219
<div class="footer-row">

public/posts/fitness-track/index.html

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -186,26 +186,24 @@ <h2>Tags</h2>
186186

187187
</div>
188188
</main>
189-
<div id="disqus_thread"></div>
189+
<div id="disqus_thread" style="width:100vw"></div>
190190
<script type="application/javascript">
191-
window.disqus_config = function () {
191+
window.disqus_config = function () {};
192+
(function() {
192193

193194

194-
195-
};
196-
(function() {
197-
if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) {
198-
document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
199-
return;
200-
}
201-
var d = document, s = d.createElement('script'); s.async = true;
202-
s.src = '//' + "singhcoder" + '.disqus.com/embed.js';
203-
s.setAttribute('data-timestamp', +new Date());
204-
(d.head || d.body).appendChild(s);
205-
})();
195+
if (["dfkjh"].indexOf(window.location.hostname) != -1) {
196+
document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
197+
return;
198+
}
199+
var d = document, s = d.createElement('script'); s.async = true;
200+
s.src = '//' + "singhcoder" + '.disqus.com/embed.js';
201+
s.setAttribute('data-timestamp', +new Date());
202+
(d.head || d.body).appendChild(s);
203+
})();
206204
</script>
207205
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
208-
<a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
206+
<a href="https://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
209207

210208
<footer class="footer">
211209
<div class="footer-row">

public/posts/index.html

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -159,26 +159,24 @@ <h2>Tags</h2>
159159

160160
</div>
161161
</main>
162-
<div id="disqus_thread"></div>
162+
<div id="disqus_thread" style="width:100vw"></div>
163163
<script type="application/javascript">
164-
window.disqus_config = function () {
164+
window.disqus_config = function () {};
165+
(function() {
165166

166167

167-
168-
};
169-
(function() {
170-
if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) {
171-
document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
172-
return;
173-
}
174-
var d = document, s = d.createElement('script'); s.async = true;
175-
s.src = '//' + "singhcoder" + '.disqus.com/embed.js';
176-
s.setAttribute('data-timestamp', +new Date());
177-
(d.head || d.body).appendChild(s);
178-
})();
168+
if (["dfkjh"].indexOf(window.location.hostname) != -1) {
169+
document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
170+
return;
171+
}
172+
var d = document, s = d.createElement('script'); s.async = true;
173+
s.src = '//' + "singhcoder" + '.disqus.com/embed.js';
174+
s.setAttribute('data-timestamp', +new Date());
175+
(d.head || d.body).appendChild(s);
176+
})();
179177
</script>
180178
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
181-
<a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
179+
<a href="https://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
182180

183181
<footer class="footer">
184182
<div class="footer-row">

public/posts/my-first-post/index.html

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -152,26 +152,24 @@ <h2>Tags</h2>
152152

153153
</div>
154154
</main>
155-
<div id="disqus_thread"></div>
155+
<div id="disqus_thread" style="width:100vw"></div>
156156
<script type="application/javascript">
157-
window.disqus_config = function () {
157+
window.disqus_config = function () {};
158+
(function() {
158159

159160

160-
161-
};
162-
(function() {
163-
if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) {
164-
document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
165-
return;
166-
}
167-
var d = document, s = d.createElement('script'); s.async = true;
168-
s.src = '//' + "singhcoder" + '.disqus.com/embed.js';
169-
s.setAttribute('data-timestamp', +new Date());
170-
(d.head || d.body).appendChild(s);
171-
})();
161+
if (["dfkjh"].indexOf(window.location.hostname) != -1) {
162+
document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
163+
return;
164+
}
165+
var d = document, s = d.createElement('script'); s.async = true;
166+
s.src = '//' + "singhcoder" + '.disqus.com/embed.js';
167+
s.setAttribute('data-timestamp', +new Date());
168+
(d.head || d.body).appendChild(s);
169+
})();
172170
</script>
173171
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
174-
<a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
172+
<a href="https://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
175173

176174
<footer class="footer">
177175
<div class="footer-row">

public/tags/fitness/index.html

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -147,26 +147,24 @@ <h2>Tags</h2>
147147

148148
</div>
149149
</main>
150-
<div id="disqus_thread"></div>
150+
<div id="disqus_thread" style="width:100vw"></div>
151151
<script type="application/javascript">
152-
window.disqus_config = function () {
152+
window.disqus_config = function () {};
153+
(function() {
153154

154155

155-
156-
};
157-
(function() {
158-
if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) {
159-
document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
160-
return;
161-
}
162-
var d = document, s = d.createElement('script'); s.async = true;
163-
s.src = '//' + "singhcoder" + '.disqus.com/embed.js';
164-
s.setAttribute('data-timestamp', +new Date());
165-
(d.head || d.body).appendChild(s);
166-
})();
156+
if (["dfkjh"].indexOf(window.location.hostname) != -1) {
157+
document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
158+
return;
159+
}
160+
var d = document, s = d.createElement('script'); s.async = true;
161+
s.src = '//' + "singhcoder" + '.disqus.com/embed.js';
162+
s.setAttribute('data-timestamp', +new Date());
163+
(d.head || d.body).appendChild(s);
164+
})();
167165
</script>
168166
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
169-
<a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
167+
<a href="https://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
170168

171169
<footer class="footer">
172170
<div class="footer-row">

public/tags/index.html

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -124,26 +124,24 @@ <h2>Tags</h2>
124124

125125
</div>
126126
</main>
127-
<div id="disqus_thread"></div>
127+
<div id="disqus_thread" style="width:100vw"></div>
128128
<script type="application/javascript">
129-
window.disqus_config = function () {
129+
window.disqus_config = function () {};
130+
(function() {
130131

131132

132-
133-
};
134-
(function() {
135-
if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) {
136-
document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
137-
return;
138-
}
139-
var d = document, s = d.createElement('script'); s.async = true;
140-
s.src = '//' + "singhcoder" + '.disqus.com/embed.js';
141-
s.setAttribute('data-timestamp', +new Date());
142-
(d.head || d.body).appendChild(s);
143-
})();
133+
if (["dfkjh"].indexOf(window.location.hostname) != -1) {
134+
document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
135+
return;
136+
}
137+
var d = document, s = d.createElement('script'); s.async = true;
138+
s.src = '//' + "singhcoder" + '.disqus.com/embed.js';
139+
s.setAttribute('data-timestamp', +new Date());
140+
(d.head || d.body).appendChild(s);
141+
})();
144142
</script>
145143
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
146-
<a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
144+
<a href="https://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
147145

148146
<footer class="footer">
149147
<div class="footer-row">

0 commit comments

Comments
 (0)