Fixed an issue with an incomplete example-config.json that made the
server not work at all. Also added a default.css file
This commit is contained in:
@@ -20,6 +20,11 @@ export function increment_hitcount(postID = -1) { // -1 Means it will increment
|
||||
writedata('posts', post, postID)
|
||||
return 0
|
||||
}
|
||||
else {
|
||||
post.hitcount = 1;
|
||||
writedata('posts', post, postID)
|
||||
return 0
|
||||
}
|
||||
return 1
|
||||
}
|
||||
}
|
||||
@@ -72,9 +77,7 @@ export function getdata(data, index=-1) {
|
||||
if (index < result.length) {
|
||||
return result[index]
|
||||
}
|
||||
else {
|
||||
return 1 // This index doesn't exist
|
||||
}
|
||||
return 1 // This index doesn't exist
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -54,14 +54,11 @@ export function unix_time_to_atom_date(unix_time) {
|
||||
export function render_tags(tags) {
|
||||
let string = "" // Initialises the string
|
||||
if (tags.length == 1 && tags[0] == "") {
|
||||
string = locale.no_tags; // If there are no tags, output something
|
||||
string = ''; // If there are no tags, output nothing
|
||||
}
|
||||
else {
|
||||
for (let tag_index = 0; tag_index < tags.length; tag_index++) { // Loop over each tag
|
||||
string += `<a href="/tag/${tags[tag_index].trim()}">${tags[tag_index].trim()}</a>` // Adds the tag to the string as a HTML href
|
||||
if (tag_index < tags.length - 1) { // If there are more tags, then insert a comma
|
||||
string += ", ";
|
||||
}
|
||||
string += `<a href="/tag/${tags[tag_index].trim()}">#${tags[tag_index].trim()}</a> ` // Adds the tag to the string as a HTML href
|
||||
}
|
||||
}
|
||||
return string
|
||||
|
||||
Reference in New Issue
Block a user