diff --git a/.gitignore b/.gitignore
index 34225d9..2ae919f 100755
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
node_modules
package-lock.json
posts.js
+comments.js
users.js
*.swp
diff --git a/README.md b/README.md
index 4c7b9e5..d5b6cdc 100644
--- a/README.md
+++ b/README.md
@@ -9,9 +9,13 @@ In action on my website: [deadvey.com](https://deadvey.com)
* rss
* timeline, user page, post page and tag specific page
* edit/delete posts
-* probably insecure as hell
* hitcount
* Markdown syntax in posts
+* Commenting on posts
+
+# Bugs
+* probably scales like shit
+* probably insecure as hell
# planned features
* atom
diff --git a/app.js b/app.js
index d749531..bab5527 100755
--- a/app.js
+++ b/app.js
@@ -3,14 +3,17 @@ const showdown = require('showdown')
const crypto = require('crypto'); // For encrypting passwords
const { fromUnixTime, format, getUnixTime } = require("date-fns")
const fs = require('fs');
+
const users = require('./users.js');
const posts = require('./posts.js');
+const comments = require('./comments.js');
const config = require('./config.js');
let converter = new showdown.Converter({simpleLineBreaks: true, tables: true, strikethrough: true, tasklists: true, encodeEmails: true})
const app = express();
let footer_div = config.site_wide_footer
footer_div = replace_format_indicators(footer_div)
+
app.use(express.urlencoded({ extended: true }));
app.use(express.json());
app.use(express.static(config.root_path));
@@ -61,6 +64,7 @@ function replace_format_indicators(input_string, post_index=0, tag_name="tag") {
.replaceAll("%G", tag_name)
.replaceAll("%I", users.users[post_object['userID']]['description'])
.replaceAll("%L", `/post/${post_index}`)
+ .replaceAll("%M", return_comments(post_index))
.replaceAll("%N", users.users[post_object["userID"]]['username'])
.replaceAll("%P", "/post")
.replaceAll("%O", `/edit/${post_index}`)
@@ -68,6 +72,12 @@ function replace_format_indicators(input_string, post_index=0, tag_name="tag") {
.replaceAll("%S", config.seperator)
.replaceAll("%T", post_object["title"])
.replaceAll("%U", `/user/${users.users[post_object["userID"]]['username']}`)
+ .replaceAll("%X", `