From bced9c7c0e167f302de89aceb982834b0c9f1e98 Mon Sep 17 00:00:00 2001 From: DeaDvey Date: Sat, 2 Aug 2025 03:00:20 +0100 Subject: [PATCH] CONFIG.md documentation and also fixed a bug where when ATOM files are loaded the config.rss boolean is actually checked as opposed to config.atom, fixed by also adding string.atom_disabled to config.json :) --- data/example-config.json | 1 + docs/CONFIG.md | 19 +++++++++++++------ src/server.js | 8 ++++---- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/data/example-config.json b/data/example-config.json index 8491f77..5df69d6 100755 --- a/data/example-config.json +++ b/data/example-config.json @@ -29,6 +29,7 @@ "delete_account_confirmation": "Delete my account - (I agree that my account and all of my posts will be permanently deleted instantly)", "incorrect_password": "Incorrect Password", "rss_disabled": "Sorry, RSS is disabled", + "atom_disabled": "Sorry, ATOM is disabled", "attribution": "Powered by blogger-nodejs: Source Code, license (WTFPL)" }, "css": "" diff --git a/docs/CONFIG.md b/docs/CONFIG.md index 1b40035..07a43b2 100755 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -33,8 +33,8 @@ All options show an example configuartion value and the variable type + an expla ## Syndication * "rss": true
Boolean. Enable or Disable RSS feeds. -* "rss_path": "/rss"
- String. The path of the global rss feed file. +* "atom": true
+ Boolean. Enable or Disable ATOM feeds. ## Dates Read more at [date-fns](https://date-fns.org/v4.1.0/docs/format)
@@ -50,7 +50,7 @@ Read more at [date-fns](https://date-fns.org/v4.1.0/docs/format)
You can also edit the custom.css file in the webroot, as by default this is linked in the global header. ## Custom Strings -All of these values are of type String +All of these values are of type String and are in the "string" object. * "signup_agreement": "I agree to not post illegal or hateful content"
The agreement people must check to signup for the server. * "signups_unavailable": "Sorry, this server does not allow signups"
@@ -59,11 +59,18 @@ All of these values are of type String The string to be shown when someone is trying to signup with a name exists. * "user_doesnt_exist": "Sorry, this user does not exist"
The string to be shown when someone tries to edit their account or make a post but the username doesn't exist. +* "comment_doesnt_exist": "This comment doesn't exist, this could be because the post it was attached to was deleted"
+ String to be shown if someone goes to /comment/commentID but that comment doesnt exist (sometimes because the post it was attatched to was deleted) +* "post_doesnt_exist": "This post doesn't exist or was deleted"
+ Shown when someone goes to /post/postID but that post was deleted or doesn't exist. * "delete_account_confirmation": "I agree that my account and all of my posts will be permanently deleted instantly"
The string to be shown as a confirmation when a user tries to delete their account. * "incorrect_password": "Incorrect Password"
The string to be shown if the password is incorrect. - -## Other +* "rss_disabled": "Sorry,·RSS·is·disabled"
+ String to be shown if an RSS file is loaded but RSS is disabled +* "atom_disabled": "Sorry, ATOM is disabled"
+ Same as above but ATOM * "attribution" = "Powered by blogger-nodejs: Source Code, license (WTFPL)" - String. Represented by format indicator %Z. Only change this value if you modify the source code or just want to change some of the formatting. + Represented by format indicator %Z. Only change this value if you modify the source code or just want to change some of the formatting. + diff --git a/src/server.js b/src/server.js index 8994821..b5f2dce 100644 --- a/src/server.js +++ b/src/server.js @@ -101,9 +101,9 @@ app.get("/user/:username/rss", (req,res) => { }); // global ATOM protocol gets app.get("/atom", (req,res) => { - if (config.rss == false) { + if (config.atom == false) { res.render("partials/message", { - message: config.string.rss_disabled, + message: config.string.atom_disabled, config: config, }) } @@ -122,9 +122,9 @@ app.get("/atom", (req,res) => { app.get("/user/:username/atom", (req,res) => { const username = req.params.username; const userID = func.get_userID(username); - if (config.rss == false) { + if (config.atom == false) { res.render("partials/message", { - message: config.string.rss_disabled, + message: config.string.atom_disabled, config: config, }) }