Compare commits

...

1 Commits

Author SHA1 Message Date
hyzen
89e5d4a0f9 Fix: email notifications for new comments showing wrong post url 2026-07-30 14:09:13 +05:30
2 changed files with 4 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@@ -38,6 +38,7 @@ end }} {{ if gt (len $blogPosts) 1 }}
(function () { (function () {
var BACKEND = 'https://backend.freedoms4.org/comments.php'; var BACKEND = 'https://backend.freedoms4.org/comments.php';
var POST_ID = {{ printf "/blog/%s/" (.File.ContentBaseName | urlize) | jsonify | safeJS }}; var POST_ID = {{ printf "/blog/%s/" (.File.ContentBaseName | urlize) | jsonify | safeJS }};
var POST_URL = {{ printf "https://freedoms4.org%s" .RelPermalink | jsonify | safeJS }};
var username = localStorage.getItem('f4_username'); var username = localStorage.getItem('f4_username');
var isAdmin = false; var isAdmin = false;
@@ -162,7 +163,7 @@ end }} {{ if gt (len $blogPosts) 1 }}
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
credentials: 'include', credentials: 'include',
body: JSON.stringify({ action: 'reply', post_id: POST_ID, parent_id: c.id, body: text }), body: JSON.stringify({ action: 'reply', post_id: POST_ID, post_url: POST_URL, parent_id: c.id, body: text }),
}) })
.then(function (r) { return r.json(); }) .then(function (r) { return r.json(); })
.then(function (d) { .then(function (d) {
@@ -235,7 +236,7 @@ end }} {{ if gt (len $blogPosts) 1 }}
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
credentials: 'include', credentials: 'include',
body: JSON.stringify({ action: 'post', post_id: POST_ID, body: text }), body: JSON.stringify({ action: 'post', post_id: POST_ID, post_url: POST_URL, body: text }),
}) })
.then(function (r) { return r.json(); }) .then(function (r) { return r.json(); })
.then(function (d) { .then(function (d) {