Rename getPostsX() to just getPost that returns all posts. mindflowDateToId renamed to date_id.

This commit is contained in:
Alexander Andreev 2022-01-21 20:55:53 +04:00
parent 1a41b3f901
commit 9b4c0e76bf
Signed by: Arav
GPG Key ID: 1327FE8A374CC86F

View File

@ -54,7 +54,7 @@ function setRoutes() {
doctype: 'xml',
schemahost: `${ctx.header.schema}://${ctx.header.host}`,
author: "me@arav.top (Alexander \"Arav\" Andreev)",
items: await mindflow.getPostsForRSS()
items: await mindflow.getPosts()
})
})
.get('/stuff', async ctx => {
@ -71,8 +71,7 @@ function setRoutes() {
description: "Here I will post updates on my infrastructure, my very important opinions and thoughts.",
files_site: util.getServiceByHost(ctx.request.host, "files"),
tz: util.getClientTimezone(ctx),
diary: await mindflow.getPosts("Diary"),
updates: await mindflow.getPosts("Update")
posts: await mindflow.getPosts()
})
})
.get('/stuff/article/:article', async ctx => {
@ -141,7 +140,7 @@ const pug = new koaPug({
viewPath: path.join(__dirname, "views"),
locals: {
date_: (date, tz) => util.datetime(date, util.date_formats.post_date, tz),
mindflowDateToId: (date, tz) => util.datetime(date, util.date_formats.id_date, tz),
date_id: (date, tz) => util.datetime(date, util.date_formats.id_date, tz),
rssLink: util.rssLink },
app: app
});