better inclusion comments

This commit is contained in:
2019-10-14 12:31:44 +02:00
parent 056cbd4be2
commit 80bf2b4517
7 changed files with 48 additions and 7 deletions

View File

@@ -0,0 +1 @@
static/comments/config.php

View File

@@ -0,0 +1,14 @@
<div class="comments-container">
<h5>Comments</h5>
<div id="statistics">
<div id="like-count-container"></div><div id="reblog-count-container"></div><div id="reply-count-container"></div>
</div>
<div class="clear"></div>
<div id="comments"></div>
<div class="clear"></div>
<div id="reference"></div>
<!--<p class="reference"><a href="https://mastodon.social/users/bjoern/statuses/{{ .Params.toot }}">Join the discussion on Mastodon!</a></p>-->
</div>
<script>var MastodonTootId="{{ .Params.toot }}"</script>
<script>var RelPermalink="{{ .RelPermalink }}"</script>

View File

@@ -1,14 +1,14 @@
$(document).ready(function() {
// check if we show a blog post or not
var isArticle = /\/?articles\/\d\d\d\d\/\d\d\/\d\d\/.+$/.test(RelPermalink);
// check if we show a blog post or not. You might have to adapt this
var isArticle = /\/?blog\/\d\d\d\d\/.+$/.test(RelPermalink);
if (isArticle === false) {
console.log("Not a blog post, no need to search for comments");
return;
}
$.ajax({
url: "https://www.schiessle.org/mastodon.comments/getcomments.php",
url: "/comments/getcomments.php",
type: "get",
data: {
search : RelPermalink