var is literally the devil

This commit is contained in:
Ellpeck 2019-10-04 23:33:45 +02:00
parent e5e2c126e2
commit 9ae98b09b3
3 changed files with 8 additions and 8 deletions

View File

@ -48,14 +48,14 @@ function createFeed(callback) {
});
fs.readFile(__dirname + "/../blog/posts.json", function (_, data) {
var json = JSON.parse(data);
let json = JSON.parse(data);
for (let i = json.length - 1; i >= 0; i--) {
var post = json[i];
var id = post["id"];
var date = new Date(post["date"]);
let post = json[i];
let id = post["id"];
let date = new Date(post["date"]);
fs.readFile(__dirname + "/../blog/" + id + ".md", function (_, content) {
var html = converter.makeHtml(content.toString());
let html = converter.makeHtml(content.toString());
feed.addItem({
title: post["name"],
id: id,

View File

@ -1,6 +1,6 @@
const express = require("express");
var app = express();
let app = express();
require("./rss")(app);
require("./sitemap")(app);
app.listen(3000);

View File

@ -32,9 +32,9 @@ module.exports = function (app) {
});
fs.readFile(__dirname + "/../blog/posts.json", function (_, data) {
var json = JSON.parse(data);
let json = JSON.parse(data);
for (var post of json) {
for (let post of json) {
sitemap.add({
url: "/#blog-" + post["id"],
priority: 0.4