From 4d2cc2501a8dd6bc1a20a6498b21f61f6e6b9a48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Val=C3=A9rio?= Date: Sat, 1 May 2021 19:17:17 +0100 Subject: [PATCH] fix missing source information. Add a few improvements to the default template. --- index.js | 4 +- templates/list_posts.handlebars | 47 ++++++++++----- templates/list_posts.precompiled.js | 91 +++++++++++++++++++++-------- 3 files changed, 100 insertions(+), 42 deletions(-) diff --git a/index.js b/index.js index bd793a0..4b453f5 100644 --- a/index.js +++ b/index.js @@ -113,8 +113,8 @@ async function fetchAndHydrate(feed) { let contentFeed = await parser.parseString(content) for (let item of contentFeed.items) { - item.source_title = feed.source_title - item.source_link = feed.link + item.source_title = contentFeed.title + item.source_link = contentFeed.link } console.log( `[fetchAndHydrate] Finished fetch feed: ${feed}. ${contentFeed.items.length} items gathered`, diff --git a/templates/list_posts.handlebars b/templates/list_posts.handlebars index 4c7b3d0..d49dde6 100644 --- a/templates/list_posts.handlebars +++ b/templates/list_posts.handlebars @@ -6,6 +6,8 @@ {{page_title}} + + @@ -13,30 +15,43 @@ -
-
- {{#each items}} +
+ {{#each items}} +
- {{/each}}
+ {{/each}}
-
\n \n \n \n' ) }, compiler: [8, '>= 4.3.0'], @@ -188,7 +188,7 @@ templates['list_posts'] = template({ }) : helper), ) + - '\n \n \n\n\n\n
\n \n\n\n\n' + ' \n \n\n\n\n' ) }, useData: true,