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
+1 -1
View File
@@ -1644,7 +1644,7 @@ Search LOGO Login Subscribe
/* 11.2. Without sidebar */ /* 11.2. Without sidebar */
.gh-container.is-list:not(.has-sidebar) :is(.gh-container-title, .gh-main, .gh-more) { .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 { .gh-container.is-grid:not(.has-sidebar) .gh-main {
+1 -1
View File
@@ -150,7 +150,7 @@
}, },
"highlight_featured_posts": { "highlight_featured_posts": {
"type": "boolean", "type": "boolean",
"default": true, "default": false,
"group": "homepage", "group": "homepage",
"visibility": "header_style:[Highlight, Magazine]" "visibility": "header_style:[Highlight, Magazine]"
}, },
+15 -3
View File
@@ -22,33 +22,45 @@
{{#match @custom.header_style "Highlight"}} {{#match @custom.header_style "Highlight"}}
{{#match posts.length ">=" 10}} {{#match posts.length ">=" 10}}
{{#if @custom.highlight_featured_posts}} {{#if @custom.highlight_featured_posts}}
{{#get "posts" limit="16"}}
{{#foreach posts from="5" limit="12"}} {{#foreach posts from="5" limit="12"}}
{{> "post-card"}} {{> "post-card"}}
{{/foreach}} {{/foreach}}
{{/get}}
{{else}} {{else}}
{{#get "posts" limit="22"}}
{{#foreach posts from="11" limit="12"}} {{#foreach posts from="11" limit="12"}}
{{> "post-card"}} {{> "post-card"}}
{{/foreach}} {{/foreach}}
{{/get}}
{{/if}} {{/if}}
{{else}} {{else}}
{{#foreach posts limit="12"}} {{#get "posts" limit="12"}}
{{#foreach posts}}
{{> "post-card"}} {{> "post-card"}}
{{/foreach}} {{/foreach}}
{{/get}}
{{/match}} {{/match}}
{{else match @custom.header_style "Magazine"}} {{else match @custom.header_style "Magazine"}}
{{#match posts.length ">=" 7}} {{#match posts.length ">=" 7}}
{{#get "posts" limit="19"}}
{{#foreach posts from="8" limit="12"}} {{#foreach posts from="8" limit="12"}}
{{> "post-card"}} {{> "post-card"}}
{{/foreach}} {{/foreach}}
{{/get}}
{{else}} {{else}}
{{#foreach posts limit="12"}} {{#get "posts" limit="12"}}
{{#foreach posts}}
{{> "post-card"}} {{> "post-card"}}
{{/foreach}} {{/foreach}}
{{/get}}
{{/match}} {{/match}}
{{else}} {{else}}
{{#foreach posts limit="12"}} {{#get "posts" limit="12"}}
{{#foreach posts}}
{{> "post-card"}} {{> "post-card"}}
{{/foreach}} {{/foreach}}
{{/get}}
{{/match}} {{/match}}
{{/match}} {{/match}}