better inclusion comments
This commit is contained in:
1
themes/hugo-mastodon-comments/.gitignore
vendored
Normal file
1
themes/hugo-mastodon-comments/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
static/comments/config.php
|
||||
14
themes/hugo-mastodon-comments/layouts/partials/comments.html
Normal file
14
themes/hugo-mastodon-comments/layouts/partials/comments.html
Normal 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>
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user