Improve JS and portability
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
$(document).ready(function() {
|
||||
|
||||
// check if we show a blog post or not. You might have to adapt this
|
||||
var isArticle = /\/?blog\/\d\d\d\d\/.+$/.test(RelPermalink);
|
||||
// check if we show a blog post or not. Regex is defined in site-wide config
|
||||
var patt = new RegExp(BlogRegex);
|
||||
console.log(patt);
|
||||
var isArticle = patt.test(RelPermalink);
|
||||
if (isArticle === false) {
|
||||
console.log("Not a blog post, no need to search for comments");
|
||||
return;
|
||||
@@ -38,11 +40,11 @@ $(document).ready(function() {
|
||||
}
|
||||
});
|
||||
if (parseInt(root) > 0) {
|
||||
$("#reference").append("<a href='https://mastodon.social/users/mxmehl/statuses/" + root + "'>Join the discussion on Mastodon!</a>");
|
||||
$("#reference").append("<a href='" + MastodonUser + "/statuses/" + root + "'>Join the discussion on Mastodon!</a>");
|
||||
} else {
|
||||
$("#comments").empty();
|
||||
$("#statistics").empty();
|
||||
$("#reference").append("Comments are handled by my <a href='https://mastodon.social/@mxmehl'>Mastodon account</a>. Sadly this article wasn't published at Mastodon. Feel free to <a href='https://mehl.mx/contact/'>send me a mail</a> if you want to share your thoughts regarding this topic.");
|
||||
$("#reference").append("Comments are handled by my <a href='" + MastodonUser + "'>Mastodon account</a>. Sadly this article wasn't published at Mastodon. Feel free to <a href='" + CommentsContact + "/'>send me a mail</a> if you want to share your thoughts regarding this topic.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user