Fixed missing posts issue on the homepage

ref DES-221
This commit is contained in:
Sodbileg Gansukh
2024-07-16 13:44:45 +08:00
parent d09d421326
commit 4af74269c7
8 changed files with 16 additions and 16 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -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;
}

View File

@@ -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) {

View File

@@ -61,7 +61,7 @@
"defaults"
],
"config": {
"posts_per_page": 16,
"posts_per_page": 12,
"image_sizes": {
"xs": {
"width": 160

View File

@@ -24,7 +24,7 @@
{{#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}}
@@ -32,7 +32,7 @@
{{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}}
@@ -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}}
@@ -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}}
@@ -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>