From 0b42a7f0da3c31045467b73a05d3b611fabef18f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Sun, 22 Feb 2026 08:13:20 +0100 Subject: [PATCH] refactor: extract post feed logic into reusable partial --- author.hbs | 27 +++++---------------------- index.hbs | 24 +----------------------- partials/post-feed.hbs | 22 ++++++++++++++++++++++ tag.hbs | 24 +----------------------- 4 files changed, 29 insertions(+), 68 deletions(-) create mode 100644 partials/post-feed.hbs diff --git a/author.hbs b/author.hbs index f7093eb..f9e7c14 100644 --- a/author.hbs +++ b/author.hbs @@ -61,26 +61,9 @@ {{/author}}
-
- {{#foreach posts}} - {{> "post-card"}} - {{/foreach}} - - {{#if pagination.next}} -
-
- {{/if}} -
- -
-
-

Loading more posts...

-
+ {{#if posts}} + {{> "post-feed"}} + {{else}} +

No posts found.

+ {{/if}}
diff --git a/index.hbs b/index.hbs index 8deba51..2b0b2b3 100644 --- a/index.hbs +++ b/index.hbs @@ -7,29 +7,7 @@
{{#if posts}} -
- {{#foreach posts}} - {{> "post-card"}} - {{/foreach}} - - {{#if pagination.next}} -
-
- {{/if}} -
- -
-
-

Loading more posts...

-
- + {{> "post-feed"}} {{else}}

No posts found.

{{/if}} diff --git a/partials/post-feed.hbs b/partials/post-feed.hbs new file mode 100644 index 0000000..ddf1b03 --- /dev/null +++ b/partials/post-feed.hbs @@ -0,0 +1,22 @@ +
+ {{#foreach posts}} + {{> "post-card"}} + {{/foreach}} + + {{#if pagination.next}} +
+
+ {{/if}} +
+ +
+
+

Loading more posts...

+
diff --git a/tag.hbs b/tag.hbs index 55c9426..799cfa2 100644 --- a/tag.hbs +++ b/tag.hbs @@ -18,29 +18,7 @@
{{#if posts}} -
- {{#foreach posts}} - {{> "post-card"}} - {{/foreach}} - - {{#if pagination.next}} -
-
- {{/if}} -
- -
-
-

Loading more posts...

-
- + {{> "post-feed"}} {{else}}

No posts found.

{{/if}}