From 169a8a24056b38628f61d7e420afd78540c544ae Mon Sep 17 00:00:00 2001 From: b1ek Date: Mon, 27 Feb 2023 16:34:08 +1000 Subject: [PATCH] add article display --- routes/homepage.js | 7 ++++++- view/main.pug | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/routes/homepage.js b/routes/homepage.js index e8057a7..cc2dbc9 100644 --- a/routes/homepage.js +++ b/routes/homepage.js @@ -9,12 +9,17 @@ async function handler(req, res) { where: { hidden: false } }); + let articles = await Sequelize.Article.findAll({ + limit: 5 + }); + res.send( await Helpers.ViewLoader.load( 'main.pug', { current_route: '/', - gb_entries + gb_entries, + articles } ) ); diff --git a/view/main.pug b/view/main.pug index 89089a2..b81d285 100644 --- a/view/main.pug +++ b/view/main.pug @@ -35,11 +35,11 @@ block content td(width='50%' style='border-left:1px solid #c2c4c2;border-right:1px solid #c2c4c2;padding:0 1%') h3 Blog ul - each i in [0,0,0,0,0] + each article in articles li(style='font-size:16pt') - | entry + h5= article.title ul - li data + li= article.shortText td(width='20%') h4 Links