Browse Source

only show comments on non-pages, and add noscript text

max.mehl 5 months ago
parent
commit
cdd5d40236
No account linked to committer's email address

+ 11
- 0
themes/hugo-mastodon-comments/layouts/partials/comments.html View File

@@ -1,5 +1,15 @@
1
+{{ if ne .Params.page true }}
1 2
 <div class="comments-container">
2 3
     <h5>Comments</h5>
4
+    <noscript>
5
+      <p class="bg-info" style="text-align: center; padding: 5px;">
6
+        Comments are only visible with JavaScript enabled. They are
7
+        dynamically  loaded from Mastodon. The code to display the
8
+        comments is Free Software and <a
9
+        href="https://src.mehl.mx/mxmehl/hugo-mastodon-comments">completely
10
+        transparent</a>.
11
+      </p>
12
+    </noscript>
3 13
     <div id="statistics">
4 14
         <div id="like-count-container"></div><div id="reblog-count-container"></div><div id="reply-count-container"></div>
5 15
     </div>
@@ -8,6 +18,7 @@
8 18
     <div class="clear"></div>
9 19
     <div id="reference"></div>
10 20
 </div>
21
+{{ end }}
11 22
 
12 23
 <script>var RelPermalink="{{ .RelPermalink }}"</script>
13 24
 <script>var MastodonUser="{{ .Site.Params.mastodoncomments.user }}"</script>

+ 0
- 1
themes/hugo-mastodon-comments/static/comments/getcomments.js View File

@@ -2,7 +2,6 @@ $(document).ready(function() {
2 2
 
3 3
     // check if we show a blog post or not. Regex is defined in site-wide config
4 4
     var patt = new RegExp(BlogRegex);
5
-    console.log(patt);
6 5
     var isArticle = patt.test(RelPermalink);
7 6
     if (isArticle === false) {
8 7
         console.log("Not a blog post, no need to search for comments");

Loading…
Cancel
Save