Browse Source

Migrate to isso from disqus

Thomas Dy 6 years ago
parent
commit
71100193a3

+ 0 - 1
config.toml

@@ -7,7 +7,6 @@ uglyUrls = true
 pygmentsUseClassic = true
 pygmentsStyle = "default"
 pygmentsCodeFences = true
-disqusShortname = "pleasantprog"
 
 paginate = 5
 

+ 1 - 1
themes/pleasant/layouts/_default/single.html

@@ -33,7 +33,7 @@
 		</nav>
 	</aside>
 	<section class="comments">
-		{{ partial "disqus.html" . }}
+		{{ partial "comments.html" . }}
 	</section>
 </article>
 </main>

+ 1 - 1
themes/pleasant/layouts/index.html

@@ -13,7 +13,7 @@
 			{{ .Content }}
 		</div>
 		<small class="dateline">Posted: <time class="published dt-published" itemprop="datePublished" datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2006-01-02" }}</time></small>
-		| <small class="commentline"><a href="{{ .RelPermalink }}#disqus_thread" data-disqus-identifier="cache/posts/{{ .Slug }}.html">Comments</a></small>
+		| <small class="commentline"><a href="{{ .RelPermalink }}#isso-thread">Comments</a></small>
 	</article>
 	</article>
 	{{ end }}

+ 7 - 0
themes/pleasant/layouts/partials/comments.html

@@ -0,0 +1,7 @@
+<script
+	data-isso="https://isso.pleasantprogrammer.com/"
+	data-isso-require-author="true"
+	data-isso-vote="false"
+	src="https://isso.pleasantprogrammer.com/js/embed.min.js">
+</script>
+<section id="isso-thread"></section>

+ 0 - 15
themes/pleasant/layouts/partials/disqus.html

@@ -1,15 +0,0 @@
-<div id="disqus_thread"></div>
-<script type="text/javascript">
-var disqus_shortname = '{{ .Site.DisqusShortname }}';
-var disqus_url = '{{ .Permalink }}';
-var disqus_title = '{{ .Title }}';
-var disqus_identifier = 'cache/posts/{{ .Slug }}.html';
-
-(function() {
-    var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
-    dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
-    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
-})();
-</script>
-<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
-<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>

+ 4 - 1
themes/pleasant/layouts/partials/footer.html

@@ -27,7 +27,10 @@ easter_egg.load();
 </script>
 
 {{ if .IsHome }}
-<script id="dsq-count-scr" type="text/javascript" src="//pleasantprog.disqus.com/count.js" async></script>
+<script
+	data-isso="https://isso.pleasantprogrammer.com/"
+	src="https://isso.pleasantprogrammer.com/js/count.min.js">
+</script>
 {{ end }}
 
 </body>

+ 4 - 0
themes/pleasant/static/assets/css/theme.css

@@ -340,3 +340,7 @@ h1 small {
   display: block;
   margin-top: 8px;
 }
+
+#isso-thread {
+  font-size: 80%;
+}