Updated number of posts to show on the homepage

This commit is contained in:
Sodbileg Gansukh 2023-09-11 15:16:34 +08:00
parent 4ca2598046
commit 912961abc5
5 changed files with 34 additions and 22 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1644,7 +1644,7 @@ Search LOGO Login Subscribe
/* 11.2. Without sidebar */
.gh-container.is-list:not(.has-sidebar) :is(.gh-container-title, .gh-main, .gh-more) {
grid-column: 4 / span 11;
grid-column: 3 / span 12;
}
.gh-container.is-grid:not(.has-sidebar) .gh-main {

View File

@ -150,7 +150,7 @@
},
"highlight_featured_posts": {
"type": "boolean",
"default": true,
"default": false,
"group": "homepage",
"visibility": "header_style:[Highlight, Magazine]"
},

View File

@ -22,33 +22,45 @@
{{#match @custom.header_style "Highlight"}}
{{#match posts.length ">=" 10}}
{{#if @custom.highlight_featured_posts}}
{{#get "posts" limit="16"}}
{{#foreach posts from="5" limit="12"}}
{{> "post-card"}}
{{/foreach}}
{{/get}}
{{else}}
{{#get "posts" limit="22"}}
{{#foreach posts from="11" limit="12"}}
{{> "post-card"}}
{{/foreach}}
{{/get}}
{{/if}}
{{else}}
{{#foreach posts limit="12"}}
{{#get "posts" limit="12"}}
{{#foreach posts}}
{{> "post-card"}}
{{/foreach}}
{{/get}}
{{/match}}
{{else match @custom.header_style "Magazine"}}
{{#match posts.length ">=" 7}}
{{#get "posts" limit="19"}}
{{#foreach posts from="8" limit="12"}}
{{> "post-card"}}
{{/foreach}}
{{/get}}
{{else}}
{{#foreach posts limit="12"}}
{{#get "posts" limit="12"}}
{{#foreach posts}}
{{> "post-card"}}
{{/foreach}}
{{/get}}
{{/match}}
{{else}}
{{#foreach posts limit="12"}}
{{#get "posts" limit="12"}}
{{#foreach posts}}
{{> "post-card"}}
{{/foreach}}
{{/get}}
{{/match}}
{{/match}}