Skip to content

Commit

Permalink
feat: add the carouselPostCount parameter which indicates the number …
Browse files Browse the repository at this point in the history
…of posts on homepage carousel
  • Loading branch information
razonyang committed Oct 30, 2023
1 parent 32f30de commit c8ac437
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ color = "auto"
customCSS = []
customJS = []
diagram = false
carouselPostCount = 5
featuredPostCount = 5
fixedHeader = true
fullWidth = false
Expand Down
3 changes: 2 additions & 1 deletion layouts/partials/carousel.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- $pages := first 3 (where $.Site.Pages "Params.carousel" true) }}
{{- $count := default 5 site.Params.carouselPostCount }}
{{- $pages := first $count (where $.Site.Pages "Params.carousel" true) }}
{{- if and .IsHome $pages (eq .Paginator.PageNumber 1) }}
<div class="container p-0 mb-4">
<div class="row p-0 m-0">
Expand Down

0 comments on commit c8ac437

Please sign in to comment.