Skip to content

Commit 5bf3743

Browse files
committed
disqus fix stillt ry
1 parent c978574 commit 5bf3743

File tree

8 files changed

+106
-85
lines changed

8 files changed

+106
-85
lines changed

layouts/partials/footer.html

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

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

public/categories/index.html

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,22 +117,25 @@ <h2>Tags</h2>
117117
</div>
118118
</main>
119119
<div id="disqus_thread"></div>
120-
<script type="text/javascript">
121-
122-
(function() {
120+
<script type="application/javascript">
121+
window.disqus_config = function () {
122+
123123

124124

125-
if (window.location.hostname == "localhost")
126-
return;
127-
128-
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
129-
var disqus_shortname = 'singhcoder';
130-
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
131-
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
132-
})();
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+
})();
133136
</script>
134137
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
135-
<a href="https://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
138+
<a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
136139

137140
<footer class="footer">
138141
<div class="footer-row">

public/index.html

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -197,22 +197,25 @@ <h2>Tags</h2>
197197
</div>
198198
</main>
199199
<div id="disqus_thread"></div>
200-
<script type="text/javascript">
201-
202-
(function() {
200+
<script type="application/javascript">
201+
window.disqus_config = function () {
202+
203203

204204

205-
if (window.location.hostname == "localhost")
206-
return;
207-
208-
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
209-
var disqus_shortname = 'singhcoder';
210-
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
211-
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
212-
})();
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+
})();
213216
</script>
214217
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
215-
<a href="https://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
218+
<a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
216219

217220
<footer class="footer">
218221
<div class="footer-row">

public/posts/fitness-track/index.html

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -187,22 +187,25 @@ <h2>Tags</h2>
187187
</div>
188188
</main>
189189
<div id="disqus_thread"></div>
190-
<script type="text/javascript">
191-
192-
(function() {
190+
<script type="application/javascript">
191+
window.disqus_config = function () {
192+
193193

194194

195-
if (window.location.hostname == "localhost")
196-
return;
197-
198-
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
199-
var disqus_shortname = 'singhcoder';
200-
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
201-
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
202-
})();
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+
})();
203206
</script>
204207
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
205-
<a href="https://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
208+
<a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
206209

207210
<footer class="footer">
208211
<div class="footer-row">

public/posts/index.html

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -160,22 +160,25 @@ <h2>Tags</h2>
160160
</div>
161161
</main>
162162
<div id="disqus_thread"></div>
163-
<script type="text/javascript">
164-
165-
(function() {
163+
<script type="application/javascript">
164+
window.disqus_config = function () {
165+
166166

167167

168-
if (window.location.hostname == "localhost")
169-
return;
170-
171-
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
172-
var disqus_shortname = 'singhcoder';
173-
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
174-
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
175-
})();
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+
})();
176179
</script>
177180
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
178-
<a href="https://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
181+
<a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
179182

180183
<footer class="footer">
181184
<div class="footer-row">

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

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -153,22 +153,25 @@ <h2>Tags</h2>
153153
</div>
154154
</main>
155155
<div id="disqus_thread"></div>
156-
<script type="text/javascript">
157-
158-
(function() {
156+
<script type="application/javascript">
157+
window.disqus_config = function () {
158+
159159

160160

161-
if (window.location.hostname == "localhost")
162-
return;
163-
164-
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
165-
var disqus_shortname = 'singhcoder';
166-
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
167-
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
168-
})();
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+
})();
169172
</script>
170173
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
171-
<a href="https://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
174+
<a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
172175

173176
<footer class="footer">
174177
<div class="footer-row">

public/tags/fitness/index.html

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -148,22 +148,25 @@ <h2>Tags</h2>
148148
</div>
149149
</main>
150150
<div id="disqus_thread"></div>
151-
<script type="text/javascript">
152-
153-
(function() {
151+
<script type="application/javascript">
152+
window.disqus_config = function () {
153+
154154

155155

156-
if (window.location.hostname == "localhost")
157-
return;
158-
159-
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
160-
var disqus_shortname = 'singhcoder';
161-
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
162-
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
163-
})();
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+
})();
164167
</script>
165168
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
166-
<a href="https://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
169+
<a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
167170

168171
<footer class="footer">
169172
<div class="footer-row">

public/tags/index.html

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -125,22 +125,25 @@ <h2>Tags</h2>
125125
</div>
126126
</main>
127127
<div id="disqus_thread"></div>
128-
<script type="text/javascript">
129-
130-
(function() {
128+
<script type="application/javascript">
129+
window.disqus_config = function () {
130+
131131

132132

133-
if (window.location.hostname == "localhost")
134-
return;
135-
136-
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
137-
var disqus_shortname = 'singhcoder';
138-
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
139-
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
140-
})();
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+
})();
141144
</script>
142145
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
143-
<a href="https://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
146+
<a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
144147

145148
<footer class="footer">
146149
<div class="footer-row">

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy