ugghhhh new site_path config option
This commit is contained in:
+5
-4
@@ -3,6 +3,7 @@
|
||||
"seperator": "<hr/>",
|
||||
"site_name": "My Blog",
|
||||
"site_url": "https://example.com",
|
||||
"site_path": "/",
|
||||
"locale": "en-US",
|
||||
"port": 8080,
|
||||
"data_storage": "json",
|
||||
@@ -13,10 +14,10 @@
|
||||
"enable_hitcount": true,
|
||||
"charset": "UTF-8",
|
||||
"root_path": "../webroot/",
|
||||
"edit_account_base_url": "/edit_account",
|
||||
"new_post_url": "/post",
|
||||
"signup_url": "/signup",
|
||||
"edit_post_base_url": "/edit",
|
||||
"edit_account_base_url": "edit_account",
|
||||
"new_post_url": "post",
|
||||
"signup_url": "signup",
|
||||
"edit_post_base_url": "edit",
|
||||
"default_commenter_username": "Anon",
|
||||
"rss": true,
|
||||
"atom": true,
|
||||
|
||||
+12
-12
@@ -14,7 +14,7 @@ const crypto = require('crypto')
|
||||
const router = express.Router();
|
||||
|
||||
////////////////////// Form actions /////////////////////////
|
||||
router.post("/submit_comment", (req,res) => {
|
||||
router.post(`${config.site_path}/submit_comment`, (req,res) => {
|
||||
const unix_timestamp = getUnixTime(new Date())
|
||||
const postID = parseInt(req.body.post_index)
|
||||
const content = func.escape_input(req.body.content)
|
||||
@@ -38,10 +38,10 @@ router.post("/submit_comment", (req,res) => {
|
||||
fs.writeFileSync(`../data/comments.json`, `${JSON.stringify(comments)}`, 'utf-8');
|
||||
}
|
||||
|
||||
res.redirect(301,`/post/${req.body.post_index}`)
|
||||
res.redirect(301,`${config.site_path}/post/${req.body.post_index}`)
|
||||
}); // /submit_comment
|
||||
|
||||
router.post("/submit_post", (req,res) => {
|
||||
router.post(`${config.site_path}/submit_post`, (req,res) => {
|
||||
const password = crypto.createHash('sha512').update(req.body.password).digest('hex');
|
||||
const username = func.escape_input(req.body.username)
|
||||
const title = func.escape_input(req.body.title)
|
||||
@@ -71,7 +71,7 @@ router.post("/submit_post", (req,res) => {
|
||||
fs.writeFileSync(`../data/posts.json`, `${JSON.stringify(posts)}`, 'utf-8');
|
||||
comments.push({'id': id, 'comments': []})
|
||||
fs.writeFileSync(`../data/comments.json`, `${JSON.stringify(comments)}`)
|
||||
res.redirect(302, "/");
|
||||
res.redirect(302, config.site_path);
|
||||
}
|
||||
else {
|
||||
res.render("partials/message", {
|
||||
@@ -81,7 +81,7 @@ router.post("/submit_post", (req,res) => {
|
||||
}
|
||||
}); // /submit_post
|
||||
|
||||
router.post("/submit_signup", (req,res) => {
|
||||
router.post(`${config.site_path}/submit_signup`, (req,res) => {
|
||||
const password = crypto.createHash('sha512').update(req.body.password).digest('hex');
|
||||
const username = func.escape_input(req.body.username)
|
||||
const prettyname = func.escape_input(req.body.prettyname)
|
||||
@@ -100,7 +100,7 @@ router.post("/submit_signup", (req,res) => {
|
||||
"description": description,
|
||||
})
|
||||
fs.writeFileSync(`../data/users.json`, `${JSON.stringify(users)}`, 'utf-8');
|
||||
res.redirect(301, `/user/${username}`)
|
||||
res.redirect(301, `${config.site_path}/user/${username}`)
|
||||
}
|
||||
// if the user does exist then
|
||||
else {
|
||||
@@ -118,12 +118,12 @@ router.post("/submit_signup", (req,res) => {
|
||||
}
|
||||
// If allow_signup is undefined or not a boolean, error
|
||||
else {
|
||||
res.redirect(301,"/")
|
||||
res.redirect(301,config.site_path)
|
||||
console.log("Error, invalid value for allow_signup (bool)")
|
||||
}
|
||||
}); // /submit_signup
|
||||
|
||||
router.post("/submit_edit_user", (req,res) => {
|
||||
router.post(`${config.site_path}/submit_edit_user`, (req,res) => {
|
||||
// Get the form info
|
||||
const password = crypto.createHash("sha512").update(req.body.password).digest("hex");
|
||||
const userID = func.escape_input(req.body.userID)
|
||||
@@ -152,7 +152,7 @@ router.post("/submit_edit_user", (req,res) => {
|
||||
fs.writeFileSync(`../data/users.json`, `${JSON.stringify(users)}`, 'utf-8');
|
||||
fs.writeFileSync(`../data/posts.json`, `${JSON.stringify(posts)}`, 'utf-8');
|
||||
fs.writeFileSync(`../data/comments.json`, `${JSON.stringify(comments)}`, 'utf-8');
|
||||
res.redirect(301,`/user/${users[userID]["username"]}`)
|
||||
res.redirect(301,`${config.site_path}/user/${users[userID]["username"]}`)
|
||||
}
|
||||
else { // password does not match
|
||||
res.render("partials/message", {
|
||||
@@ -170,7 +170,7 @@ router.post("/submit_edit_user", (req,res) => {
|
||||
}
|
||||
}); // /submit_delete_account
|
||||
|
||||
router.post("/submit_edit_post", (req,res) => {
|
||||
router.post(`${config.site_path}/submit_edit_post`, (req,res) => {
|
||||
const password = crypto.createHash('sha512').update(req.body.password).digest('hex');
|
||||
const postID = req.body.postID
|
||||
const userID = req.body.userID
|
||||
@@ -194,7 +194,7 @@ router.post("/submit_edit_post", (req,res) => {
|
||||
fs.writeFileSync(`../data/comments.json`, `${JSON.stringify(comments)}`, 'utf-8');
|
||||
}
|
||||
fs.writeFileSync(`../data/posts.json`, `${JSON.stringify(posts)}`, 'utf-8');
|
||||
res.redirect(302, "/");
|
||||
res.redirect(302, config.site_path);
|
||||
}
|
||||
else {
|
||||
res.render("partials/message", {
|
||||
@@ -204,7 +204,7 @@ router.post("/submit_edit_post", (req,res) => {
|
||||
}
|
||||
}); // /submit_edit
|
||||
|
||||
router.get('/search', (req, res) => {
|
||||
router.get(`${config.site_path}/search`, (req, res) => {
|
||||
const search_term = func.escape_input(req.query.q); // 'q' is the parameter name
|
||||
let search_type = req.query.type; // eg 'post', 'user'
|
||||
if (typeof search_type == 'string') { // Make the search_term an array
|
||||
|
||||
+4
-4
@@ -5,13 +5,13 @@ const func = require('../functions')
|
||||
const router = express.Router();
|
||||
|
||||
///////////////////// Form pages ////////////////////////////
|
||||
router.get(config.new_post_url, (req,res) => {
|
||||
router.get(`${config.site_path}/${config.new_post_url}`, (req,res) => {
|
||||
res.render("forms/new_post", {
|
||||
config,
|
||||
locale,
|
||||
});
|
||||
}); // /post
|
||||
router.get(config.signup_url, (req,res) => {
|
||||
router.get(`${config.site_path}/${config.signup_url}`, (req,res) => {
|
||||
// if the server does allow signup
|
||||
if (config.allow_signup == true) {
|
||||
// Send the page for signing up to the server
|
||||
@@ -33,7 +33,7 @@ router.get(config.signup_url, (req,res) => {
|
||||
console.log("Error, invalid value for allow_signup (bool)")
|
||||
}
|
||||
}); // /signup
|
||||
router.get(`${config.edit_account_base_url}/:user_id`, (req,res) => {
|
||||
router.get(`${config.site_path}/${config.edit_account_base_url}/:user_id`, (req,res) => {
|
||||
const userID = parseInt(req.params.user_id);
|
||||
res.render("forms/edit_account", {
|
||||
config,
|
||||
@@ -42,7 +42,7 @@ router.get(`${config.edit_account_base_url}/:user_id`, (req,res) => {
|
||||
userID
|
||||
});
|
||||
}); // /delete_account
|
||||
router.get(`${config.edit_post_base_url}/:post_id`, (req,res) => {
|
||||
router.get(`${config.site_path}/${config.edit_post_base_url}/:post_id`, (req,res) => {
|
||||
const postID = req.params.post_id
|
||||
const post = data.getdata('posts','id', postID)
|
||||
const user = data.getdata('users', 'id', post.userID)
|
||||
|
||||
@@ -6,7 +6,7 @@ const func = require('../functions')
|
||||
const router = express.Router();
|
||||
|
||||
///////////////////// Page index's ///////////////////////
|
||||
router.get("/index/pages", (req,res) => {
|
||||
router.get(`${config.site_path}/index/pages`, (req,res) => {
|
||||
res.render("indexes/all_pages", {
|
||||
config,
|
||||
posts: data.getdata('posts'),
|
||||
@@ -14,19 +14,19 @@ router.get("/index/pages", (req,res) => {
|
||||
comments: data.getdata('comments'),
|
||||
});
|
||||
}); // /index/pages
|
||||
router.get("/index/posts", (req,res) => {
|
||||
router.get(`${config.site_path}/index/posts`, (req,res) => {
|
||||
res.render("indexes/posts", {
|
||||
config,
|
||||
posts: data.getdata('posts'),
|
||||
});
|
||||
}); // /index/posts
|
||||
router.get("/index/users", (req,res) => {
|
||||
router.get(`${config.site_path}/index/users`, (req,res) => {
|
||||
res.render("indexes/users", {
|
||||
config,
|
||||
users: data.getdata('users'),
|
||||
});
|
||||
}); // /index/users
|
||||
router.get("/index/comments", (req,res) => {
|
||||
router.get(`${config.site_path}/index/comments`, (req,res) => {
|
||||
res.render("indexes/comments", {
|
||||
config,
|
||||
comments: data.getdata('comments'),
|
||||
|
||||
@@ -9,7 +9,7 @@ const router = express.Router();
|
||||
///////////////////// Standard Pages //////////////////////
|
||||
|
||||
// Timeline
|
||||
router.get("/", (req,res) => {
|
||||
router.get(config.site_path, (req,res) => {
|
||||
// Increment the hitcount
|
||||
if (config.enable_hitcount) {
|
||||
data.increment_hitcount()
|
||||
@@ -31,7 +31,7 @@ router.get("/", (req,res) => {
|
||||
}); // /
|
||||
|
||||
// Users
|
||||
router.get("/user/:username", (req, res) => {
|
||||
router.get(`${config.site_path}/user/:username`, (req, res) => {
|
||||
const userID = func.get_userID(req.params.username)
|
||||
let user = data.getdata('users', 'id', userID)
|
||||
if (userID != -1) {
|
||||
@@ -59,7 +59,7 @@ router.get("/user/:username", (req, res) => {
|
||||
}); // /user/:username
|
||||
|
||||
// Posts
|
||||
router.get("/post/:post_index", (req, res) => {
|
||||
router.get(`${config.site_path}/post/:post_index`, (req, res) => {
|
||||
const postID = parseInt(req.params.post_index)
|
||||
let post = data.getdata('posts','id', postID)
|
||||
if (post == 1) { // data.getdata returns error code 1 if nothing is available
|
||||
@@ -94,7 +94,7 @@ router.get("/post/:post_index", (req, res) => {
|
||||
|
||||
|
||||
// Tags
|
||||
router.get("/tag/:tag", (req,res) => {
|
||||
router.get(`${config.site_path}/tag/:tag`, (req,res) => {
|
||||
const tag = req.params.tag
|
||||
res.render("pages/tag",
|
||||
{
|
||||
@@ -113,7 +113,7 @@ router.get("/tag/:tag", (req,res) => {
|
||||
|
||||
|
||||
// Comments
|
||||
router.get("/comment/:postID-:commentID", (req,res) => {
|
||||
router.get(`${config.site_path}/comment/:postID-:commentID`, (req,res) => {
|
||||
const commentID = parseInt(req.params.commentID);
|
||||
const postID = parseInt(req.params.postID);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ const router = express.Router();
|
||||
|
||||
////////////////////// SYNDICATION ////////////////////////
|
||||
// global RSS protocol gets
|
||||
router.get("/rss", (req,res) => {
|
||||
router.get(`${config.site_path}/rss`, (req,res) => {
|
||||
if (config.rss == false) {
|
||||
res.render("partials/message", {
|
||||
message: locale.rss_disabled,
|
||||
@@ -26,7 +26,7 @@ router.get("/rss", (req,res) => {
|
||||
};
|
||||
});
|
||||
// user RSS protocol gets
|
||||
router.get("/user/:username/rss", (req,res) => {
|
||||
router.get(`${config.site_path}/user/:username/rss`, (req,res) => {
|
||||
const username = req.params.username;
|
||||
const userID = func.get_userID(username);
|
||||
if (config.rss == false) {
|
||||
@@ -46,7 +46,7 @@ router.get("/user/:username/rss", (req,res) => {
|
||||
};
|
||||
});
|
||||
// global ATOM protocol gets
|
||||
router.get("/atom", (req,res) => {
|
||||
router.get(`${config.site_path}/atom`, (req,res) => {
|
||||
if (config.atom == false) {
|
||||
res.render("partials/message", {
|
||||
message: locale.atom_disabled,
|
||||
@@ -64,7 +64,7 @@ router.get("/atom", (req,res) => {
|
||||
};
|
||||
});
|
||||
// user ATOM protocol gets
|
||||
router.get("/user/:username/atom", (req,res) => {
|
||||
router.get(`${config.site_path}/user/:username/atom`, (req,res) => {
|
||||
const username = req.params.username;
|
||||
const userID = func.get_userID(username);
|
||||
if (config.atom == false) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<%- include("../partials/head") %>
|
||||
</head>
|
||||
<body>
|
||||
<form action="<%= config.site_url %>/submit_edit_user" method="POST">
|
||||
<form action="<%= config.site_path %>/submit_edit_user" method="POST">
|
||||
<input name="userID" type="hidden" value="<%= userID %>">
|
||||
<label><%= locale.password %>:</label><br/>
|
||||
<input type="password" required id="password" name="password"><br/><br/>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<%- include("../partials/head") %>
|
||||
</head>
|
||||
<body>
|
||||
<form action="<%= config.site_url %>/submit_edit_post" method="POST" onsubmit="sha512password()">
|
||||
<form action="<%= config.site_path %>/submit_edit_post" method="POST" onsubmit="sha512password()">
|
||||
<input name="userID" type="hidden" value="<%= post['userID'] %>">
|
||||
<input name="postID" type="hidden" value="<%= postID %>">
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<%- include('../partials/head.ejs') %>
|
||||
</head>
|
||||
<body>
|
||||
<form action="<%= config.site_url %>/submit_post" method="POST">
|
||||
<form action="<%= config.site_path %>/submit_post" method="POST">
|
||||
<label><%= locale.username %>:</label><br/>
|
||||
<input required name="username"><br/><br/>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<%- include("../partials/head") %>
|
||||
</head>
|
||||
<body>
|
||||
<form action="<%= config.site_url %>/submit_signup" method="POST">
|
||||
<form action="<%= config.site_path %>/submit_signup" method="POST">
|
||||
<label><%= locale.username %></label><br/>
|
||||
<input required name="username"><br/><br/>
|
||||
|
||||
|
||||
@@ -1,28 +1,29 @@
|
||||
<a id='home-page-link' href="<%= config.site_url %>"><%= locale.home_page %></a>
|
||||
<a id='home-page-link' href="<%= config.site_path %>"><%= locale.home_page %></a>
|
||||
/
|
||||
<% if (config.rss == true) { %>
|
||||
<a id='rss-link' href="<%= config.site_url %>/rss">
|
||||
<img class='icon' src='<%= config.site_url %>/icons/rss.png' alt="<%= locale.rss_feed %>" title='<%= locale.rss_feed %>'>
|
||||
<a id='rss-link' href="<%= config.site_path %>/rss">
|
||||
<img class='icon' src='<%= config.site_path %>/icons/rss.png' alt="<%= locale.rss_feed %>" title='<%= locale.rss_feed %>'>
|
||||
</a>
|
||||
<% } %>
|
||||
|
|
||||
<% if (config.atom == true) { %>
|
||||
<a id='atom-link' href="<%= config.site_url %>/atom">
|
||||
<img class='icon' src='<%= config.site_url %>/icons/atom.png' alt='<%= locale.atom_feed %>' title='<%= locale.atom_feed %>'>
|
||||
<a id='atom-link' href="<%= config.site_path %>/atom">
|
||||
<img class='icon' src='<%= config.site_path %>/icons/atom.png' alt='<%= locale.atom_feed %>' title='<%= locale.atom_feed %>'>
|
||||
</a>
|
||||
<% } %>
|
||||
/
|
||||
<a id='new-post-link' href="<%= config.site_url %><%= config.new_post_url %>"><%= locale.new_post %></a>
|
||||
<a id='new-post-link' href="<%= config.site_path %><%= config.new_post_url %>"><%= locale.new_post %></a>
|
||||
/
|
||||
<% if (config.allow_signup == true) { %>
|
||||
<a id='signup-link' href="<%= config.site_url %><%= config.signup_url %>"><%= locale.sign_up %></a>
|
||||
<a id='signup-link' href="<%= config.site_path %><%= config.signup_url %>"><%= locale.sign_up %></a>
|
||||
<% } %>
|
||||
/
|
||||
<form id='search-form' method="GET" action="<%= config.site_url %>/search" style="display: inline">
|
||||
<form id='search-form' method="GET" action="<%= config.site_path %>/search" style="display: inline">
|
||||
<input type="text" placeholder="🔍" name="q"><input type="submit" value="Search">
|
||||
</form>
|
||||
<br/>
|
||||
<div id='site-name'>
|
||||
<h1><a id='home-page-link' href="<%= config.site_url %>"><%= config.site_name %></a></h1>
|
||||
<h1><a id='home-page-link' href="<%= config.site_path %>"><%= config.site_name %></a></h1>
|
||||
</div>
|
||||
<div id='site-description'>
|
||||
<h2><%- config.site_description %></h2>
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
</h1>
|
||||
</div>
|
||||
<p><%- func.render_md(user.description) %></p>
|
||||
<a if='edit-account-link' href="<%= config.site_url %><%= config.edit_account_base_url %>/<%= userID %>">
|
||||
<img class='icon' src='<%= config.site_url %>/icons/edit.png' alt='<%= locale.edit_account %>' title='<%= locale.edit_account %>'>
|
||||
<a if='edit-account-link' href="<%= config.site_path %><%= config.edit_account_base_url %>/<%= userID %>">
|
||||
<img class='icon' src='<%= config.site_path %>/icons/edit.png' alt='<%= locale.edit_account %>' title='<%= locale.edit_account %>'>
|
||||
</a>
|
||||
|
|
||||
<a id='rss-link' href="<%= config.site_url %>/user/<%= user.username %>/rss">
|
||||
<img class='icon' src='<%= config.site_url %>/icons/rss.png' alt="<%= locale.rss_feed %>" title='<%= locale.rss_feed %>'>
|
||||
<a id='rss-link' href="<%= config.site_path %>/user/<%= user.username %>/rss">
|
||||
<img class='icon' src='<%= config.site_path %>/icons/rss.png' alt="<%= locale.rss_feed %>" title='<%= locale.rss_feed %>'>
|
||||
</a>
|
||||
<a id='atom-link' href="<%= config.site_url %>/user/<%= user.username %>/atom">
|
||||
<img class='icon' src='<%= config.site_url %>/icons/atom.png' alt='<%= locale.atom_feed %>' title='<%= locale.atom_feed %>'>
|
||||
<a id='atom-link' href="<%= config.site_path %>/user/<%= user.username %>/atom">
|
||||
<img class='icon' src='<%= config.site_path %>/icons/atom.png' alt='<%= locale.atom_feed %>' title='<%= locale.atom_feed %>'>
|
||||
</a>
|
||||
<%- config.seperator %>
|
||||
|
||||
+11
-11
@@ -5,41 +5,41 @@
|
||||
</head>
|
||||
<body>
|
||||
Misc:<br/>
|
||||
<a href="<%= config.site_url %>/">Home Page</a><br/>
|
||||
<a href="<%= config.site_url %><%= config.new_post_url %>">New Post Form</a><br/>
|
||||
<a href="<%= config.site_url %><%= config.signup_url %>">Signup Form</a><br/>
|
||||
<a href="<%= config.site_path %>/">Home Page</a><br/>
|
||||
<a href="<%= config.site_path %><%= config.new_post_url %>">New Post Form</a><br/>
|
||||
<a href="<%= config.site_path %><%= config.signup_url %>">Signup Form</a><br/>
|
||||
Indexes:<br/>
|
||||
<a href="<%= config.site_url %>/index/posts">Posts Index</a><br/>
|
||||
<a href="<%= config.site_url %>/index/users">Users Index</a><br/>
|
||||
<a href="<%= config.site_url %>/index/comments">Comments Index</a><br/>
|
||||
<a href="<%= config.site_path %>/index/posts">Posts Index</a><br/>
|
||||
<a href="<%= config.site_path %>/index/users">Users Index</a><br/>
|
||||
<a href="<%= config.site_path %>/index/comments">Comments Index</a><br/>
|
||||
Posts:<br/>
|
||||
<% for (let postID = 0; postID < posts.length; postID++) { %>
|
||||
<% if (posts[postID]["deleted"] != true) { %>
|
||||
<a href="<%= config.site_url %>/post/<%= postID %>"><%= posts[postID]["title"] %></a><br/>
|
||||
<a href="<%= config.site_path %>/post/<%= postID %>"><%= posts[postID]["title"] %></a><br/>
|
||||
<% }; %>
|
||||
<% }; %>
|
||||
Comments:<br/>
|
||||
<% for (let postID = 0; postID < comments.length; postID++) { %>
|
||||
<% for (let comment_index = 0; comment_index < comments[postID]['comments'].length; comment_index++) { %>
|
||||
<a href="<%= config.site_url %>/comment/<%= postID %>-<%= comment_index %>"><%= postID %>-<%= comment_index %></a><br/>
|
||||
<a href="<%= config.site_path %>/comment/<%= postID %>-<%= comment_index %>"><%= postID %>-<%= comment_index %></a><br/>
|
||||
<% }; %>
|
||||
<% }; %>
|
||||
Users:<br/>
|
||||
<% for (let userID = 0; userID < users.length; userID++) { %>
|
||||
<% if (users[userID]["deleted"] != true) { %>
|
||||
<a href="<%= config.site_url %>/user/<%= users[userID]["username"] %>"><%= users[userID]["username"] %></a><br/>
|
||||
<a href="<%= config.site_path %>/user/<%= users[userID]["username"] %>"><%= users[userID]["username"] %></a><br/>
|
||||
<% }; %>
|
||||
<% }; %>
|
||||
Edit Posts:<br/>
|
||||
<% for (let postID = 0; postID < posts.length; postID++) { %>
|
||||
<% if (posts[postID]["deleted"] != true) { %>
|
||||
<a href="<%= config.site_url %><%= config.edit_post_base_url %>/<%= postID %>">Edit <%= posts[postID]["title"] %></a><br/>
|
||||
<a href="<%= config.site_path %><%= config.edit_post_base_url %>/<%= postID %>">Edit <%= posts[postID]["title"] %></a><br/>
|
||||
<% }; %>
|
||||
<% }; %>
|
||||
Edit Users:<br/>
|
||||
<% for (let userID = 0; userID < users.length; userID++) { %>
|
||||
<% if (users[userID]["deleted"] != true) { %>
|
||||
<a href="<%= config.site_url %><%= config.edit_account_base_url %>/<%= users[userID]["username"] %>">Edit <%= users[userID]["username"] %></a><br/>
|
||||
<a href="<%= config.site_path %><%= config.edit_account_base_url %>/<%= users[userID]["username"] %>">Edit <%= users[userID]["username"] %></a><br/>
|
||||
<% }; %>
|
||||
<% }; %>
|
||||
<!-- TODO add tags -->
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<body>
|
||||
<% for (let postID = 0; postID < comments.length; postID++) { %>
|
||||
<% for (let comment_index = 0; comment_index < comments[postID]['comments'].length; comment_index++) { %>
|
||||
<a href="<%= config.site_url %>/comment/<%= postID %>-<%= comment_index %>"><%= postID %>-<%= comment_index %></a><br/>
|
||||
<a href="<%= config.site_path %>/comment/<%= postID %>-<%= comment_index %>"><%= postID %>-<%= comment_index %></a><br/>
|
||||
<% }; %>
|
||||
<% }; %>
|
||||
</body>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<body>
|
||||
<% for (let postID = 0; postID < posts.length; postID++) { %>
|
||||
<% if (posts[postID]["deleted"] != true) { %>
|
||||
<a href="<%= config.site_url %>/post/<%= postID %>"><%= posts[postID]["title"] %></a><br/>
|
||||
<a href="<%= config.site_path %>/post/<%= postID %>"><%= posts[postID]["title"] %></a><br/>
|
||||
<% }; %>
|
||||
<% }; %>
|
||||
</body>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<body>
|
||||
<% for (let userID = 0; userID < users.length; userID++) { %>
|
||||
<% if (users[userID]["deleted"] != true) { %>
|
||||
<a href="<%= config.site_url %>/user/<%= users[userID]["username"] %>"><%= users[userID]["username"] %></a><br/>
|
||||
<a href="<%= config.site_path %>/user/<%= users[userID]["username"] %>"><%= users[userID]["username"] %></a><br/>
|
||||
<% }; %>
|
||||
<% }; %>
|
||||
</body>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<%= func.unix_time_to_date_format(comment.pubdate) %>
|
||||
</span>
|
||||
<span id='comment-id' style='display: inline'>
|
||||
<a href='<%= config.site_url %>/comment/<%= postID %>-<%= comment.id %>'>No. <%= postID %>-<%= comment.id %></a>:<br/>
|
||||
<a href='<%= config.site_path %>/comment/<%= postID %>-<%= comment.id %>'>No. <%= postID %>-<%= comment.id %></a>:<br/>
|
||||
</span>
|
||||
<span id='comment-content'>
|
||||
<%- func.render_comment(comment.content) %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<a id='site-index-link' href="<%= config.site_url %>/index/pages"><%= locale.site_index %></a><br/>
|
||||
<a id='site-index-link' href="<%= config.site_path %>/index/pages"><%= locale.site_index %></a><br/>
|
||||
<%= locale.site_ran_by %> <%= config.site_admin %><br/>
|
||||
<%- locale.attribution %><br/>
|
||||
<%= locale.AI_consent %> <!-- remove consent for AI scrapers -->
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<meta charset="<%- config.charset %>">
|
||||
<meta name='robots' content='noindex'>
|
||||
<title><%= config.site_name %></title>
|
||||
<title><%= config.site_path %></title>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<link rel="stylesheet" href="<%= config.site_url %>/default.css">
|
||||
<link rel="stylesheet" href="<%= config.site_url %>/custom.css">
|
||||
<link rel="stylesheet" href="<%= config.site_path %>/default.css">
|
||||
<link rel="stylesheet" href="<%= config.site_path %>/custom.css">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div id="post-header">
|
||||
<h2>
|
||||
<a href='<%= config.site_url %>/post/<%= post['id'] %>'><%= post.title %></a>
|
||||
<a href='<%= config.site_path %>/post/<%= post['id'] %>'><%= post.title %></a>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</div>
|
||||
<div id="post-details">
|
||||
<span id="post-author">
|
||||
<i><%= locale.written_by %> <a href="<%= config.site_url %>/user/<%= user.username %>"><%= user.prettyname %></a></i>
|
||||
<i><%= locale.written_by %> <a href="<%= config.site_path %>/user/<%= user.username %>"><%= user.prettyname %></a></i>
|
||||
</span>
|
||||
-
|
||||
<span id="post-pubdate">
|
||||
@@ -25,8 +25,8 @@
|
||||
<i><%= locale.last_modified %>: <%= func.unix_time_to_date_format(post.pubdate) %></i><br/>
|
||||
</div>
|
||||
<div id="post-edit">
|
||||
<a href="<%= config.site_url %><%= config.edit_post_base_url %>/<%= post["id"] %>">
|
||||
<img class='icon' src='<%= config.site_url %>/icons/edit.png' alt='<%= locale.edit_post %>' title='<%= locale.edit_post %>'>
|
||||
<a href="<%= config.site_path %><%= config.edit_post_base_url %>/<%= post["id"] %>">
|
||||
<img class='icon' src='<%= config.site_path %>/icons/edit.png' alt='<%= locale.edit_post %>' title='<%= locale.edit_post %>'>
|
||||
</a><br/>
|
||||
</div>
|
||||
<% if (config.enable_hitcount == true) { %>
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
<div id="post-commentform">
|
||||
<!-- Comment form -->
|
||||
<form method="POST" action="<%= config.site_url %>/submit_comment">
|
||||
<form method="POST" action="<%= config.site_path %>/submit_comment">
|
||||
<input type="hidden" name="post_index" value="<%= post["id"] %>">
|
||||
<label><%= locale.username %>:</label><br/><input name="name"><br/><br/>
|
||||
<label><%= locale.comment %>:</label><br/><textarea name="content"></textarea><br/>
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
<div id="post-header">
|
||||
<h2>
|
||||
<a href='<%= config.site_url %>/post/<%= post['id'] %>'><%= post.title %></a>
|
||||
<a href='<%= config.site_path %>/post/<%= post['id'] %>'><%= post.title %></a>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</div>
|
||||
<div id="post-details">
|
||||
<span id="post-author">
|
||||
<i><a href="<%= config.site_url %>/user/<%= user.username %>"><%= user.prettyname %></a></i>
|
||||
<i><a href="<%= config.site_path %>/user/<%= user.username %>"><%= user.prettyname %></a></i>
|
||||
</span>
|
||||
-
|
||||
<span id="post-pubdate">
|
||||
@@ -24,7 +24,7 @@
|
||||
<br/>
|
||||
<div id="post-edit">
|
||||
<a href="<%= config.edit_post_base_url %>/<%= post["id"] %>">
|
||||
<img class='icon' src='<%= config.site_url %>/icons/edit.png' alt='<%= locale.edit_post %>' title='<%= locale.edit_post %>'>
|
||||
<img class='icon' src='<%= config.site_path %>/icons/edit.png' alt='<%= locale.edit_post %>' title='<%= locale.edit_post %>'>
|
||||
</a><br/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div id="post-header">
|
||||
<h2>
|
||||
<a href='<%= config.site_url %>/post/<%= post['id'] %>'><%= post.title %></a>
|
||||
<a href='<%= config.site_path %>/post/<%= post['id'] %>'><%= post.title %></a>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
</div>
|
||||
<div id="post-details">
|
||||
<span id="post-author">
|
||||
<i><a href="<%= config.site_url %>/user/<%= user.username %>"><%= user.prettyname %></a></i>
|
||||
<i><a href="<%= config.site_path %>/user/<%= user.username %>"><%= user.prettyname %></a></i>
|
||||
</span>
|
||||
-
|
||||
<a if='edit-account-link' href="<%= config.site_url %><%= config.edit_account_base_url %>/<%= user.id %>">
|
||||
<img class='icon' src='<%= config.site_url %>/icons/edit.png' alt='<%= locale.edit_account %>' title='<%= locale.edit_account %>'>
|
||||
<a if='edit-account-link' href="<%= config.site_path %><%= config.edit_account_base_url %>/<%= user.id %>">
|
||||
<img class='icon' src='<%= config.site_path %>/icons/edit.png' alt='<%= locale.edit_account %>' title='<%= locale.edit_account %>'>
|
||||
</a>
|
||||
-
|
||||
<span id="post-pubdate">
|
||||
@@ -27,8 +27,8 @@
|
||||
</span>
|
||||
<br/>
|
||||
<div id="post-edit">
|
||||
<a href="<%= config.site_url %><%= config.edit_post_base_url %>/<%= post["id"] %>">
|
||||
<img class='icon' src='<%= config.site_url %>/icons/edit.png' alt='<%= locale.edit_post %>' title='<%= locale.edit_post %>'>
|
||||
<a href="<%= config.site_path %><%= config.edit_post_base_url %>/<%= post["id"] %>">
|
||||
<img class='icon' src='<%= config.site_path %>/icons/edit.png' alt='<%= locale.edit_post %>' title='<%= locale.edit_post %>'>
|
||||
</a><br/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div id="post-header">
|
||||
<h2>
|
||||
<a href='<%= config.site_url %>/post/<%= post['id'] %>'><%= post.title %></a>
|
||||
<a href='<%= config.site_path %>/post/<%= post['id'] %>'><%= post.title %></a>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</div>
|
||||
<div id="post-details">
|
||||
<span id="post-author">
|
||||
<i><a href="<%= config.site_url %>/user/<%= user.username %>"><%= user.prettyname %></a></i>
|
||||
<i><a href="<%= config.site_path %>/user/<%= user.username %>"><%= user.prettyname %></a></i>
|
||||
</span>
|
||||
-
|
||||
<span id="post-pubdate">
|
||||
@@ -23,8 +23,8 @@
|
||||
</span>
|
||||
<br/>
|
||||
<div id="post-edit">
|
||||
<a href="<%= config.site_url %><%= config.edit_post_base_url %>/<%= post["id"] %>">
|
||||
<img class='icon' src='<%= config.site_url %>/icons/edit.png' alt='<%= locale.edit_post %>' title='<%= locale.edit_post %>'>
|
||||
<a href="<%= config.site_path %><%= config.edit_post_base_url %>/<%= post["id"] %>">
|
||||
<img class='icon' src='<%= config.site_path %>/icons/edit.png' alt='<%= locale.edit_post %>' title='<%= locale.edit_post %>'>
|
||||
</a><br/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user