Skip to content

Commit

Permalink
Fixed missing posts issue on the homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
minimaluminium committed Jul 16, 2024
1 parent d09d421 commit 4af7426
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion assets/built/screen.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/built/screen.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/built/source.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/built/source.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/screen.css
Original file line number Diff line number Diff line change
Expand Up @@ -1594,7 +1594,7 @@ Search LOGO Login Subscribe
grid-column: span 12;
}

.home-template .gh-more {
.home-template .gh-feed:has(> :nth-child(12):last-child) ~ .gh-more {
display: block;
}

Expand Down
2 changes: 1 addition & 1 deletion assets/js/pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ function pagination(isInfinite = true, done, isMasonry = false) {
if (!feedElement) return;

let loading = false;
const target = feedElement.nextElementSibling || document.querySelector('.gh-footer');
const target = document.querySelector('.gh-footer');
const buttonElement = document.querySelector('.gh-loadmore');

if (!document.querySelector('link[rel=next]') && buttonElement) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"defaults"
],
"config": {
"posts_per_page": 16,
"posts_per_page": 12,
"image_sizes": {
"xs": {
"width": 160
Expand Down
18 changes: 9 additions & 9 deletions partials/components/post-list.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
{{#if @custom.show_featured_posts}}
{{#match posts.length ">=" 4}}
{{#get "posts" include="authors" limit="16"}}
{{#foreach posts from="5" limit="12"}}
{{#foreach posts from="5"}}
{{> "post-card" lazyLoad=true}}
{{/foreach}}
{{/get}}
{{/match}}
{{else}}
{{#match posts.length ">=" 10}}
{{#get "posts" include="authors" limit="22"}}
{{#foreach posts from="11" limit="12"}}
{{#foreach posts from="11"}}
{{> "post-card" lazyLoad=true}}
{{/foreach}}
{{/get}}
Expand All @@ -41,7 +41,7 @@
{{else match @custom.header_style "Magazine"}}
{{#match posts.length ">=" 7}}
{{#get "posts" include="authors" limit="19"}}
{{#foreach posts from="8" limit="12"}}
{{#foreach posts from="8"}}
{{> "post-card" lazyLoad=true}}
{{/foreach}}
{{/get}}
Expand Down Expand Up @@ -77,6 +77,12 @@
{{/match}}

</div>

{{#match pagination.pages ">" 1}}
<div class="gh-more is-title">
<a href="{{@site.url}}/page/2">See all {{> "icons/arrow"}}</a>
</div>
{{/match}}
</main>

{{#if showSidebar}}
Expand Down Expand Up @@ -113,11 +119,5 @@
</aside>
{{/if}}

{{#match pagination.pages ">" 1}}
<div class="gh-more is-title">
<a href="{{@site.url}}/page/2">See all {{> "icons/arrow"}}</a>
</div>
{{/match}}

</div>
</section>

0 comments on commit 4af7426

Please sign in to comment.