From 701b60f2c9bb0920ce741e4517406a03d45699f9 Mon Sep 17 00:00:00 2001 From: Sodbileg Gansukh Date: Thu, 21 Sep 2023 19:23:34 +0800 Subject: [PATCH] Show the recent posts section only when there are some --- partials/components/post-list.hbs | 9 --------- post.hbs | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/partials/components/post-list.hbs b/partials/components/post-list.hbs index 21e656d..dbaca97 100644 --- a/partials/components/post-list.hbs +++ b/partials/components/post-list.hbs @@ -76,15 +76,6 @@ {{/foreach}} {{/match}} - {{!-- Recent posts --}} - {{#match feed "recent"}} - {{#get "posts" include="authors" filter="id:-{{post.id}}" limit="4" as |next|}} - {{#foreach next}} - {{> "post-card" lazyLoad=true}} - {{/foreach}} - {{/get}} - {{/match}} - diff --git a/post.hbs b/post.hbs index efb90b5..de7d367 100644 --- a/post.hbs +++ b/post.hbs @@ -60,4 +60,17 @@ {{/post}} -{{> "components/post-list" feed="recent" postFeedStyle="Grid" title="Read more" showTitle=true showSidebar=false}} \ No newline at end of file +{{#get "posts" include="authors" filter="id:-{{post.id}}" limit="4" as |next|}} + {{#if next}} +
+
+

Read more

+
+ {{#foreach next}} + {{> "post-card" lazyLoad=true}} + {{/foreach}} +
+
+
+ {{/if}} +{{/get}} \ No newline at end of file