Closed Lkzeu closed 2 months ago
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Thank you for your reply, @adityatelange!
paginate: 5
will make each page on your site only have 5 items. If the page has more, a “next” button will be placed at the end of the listed items.
but what if I want to list 10 posts in /posts/
but only 3 on my home page? Also, I don't want "next" to appear on the home page. I could put a "see all posts" at the end of the list that will point to /posts/
and so on.
If maxPostsOnHomePage <= paginate
then it will limit the number of posts shown on the home page without a "next" button and without changing how items are listed on other pages of the site, making this theme even more customizable.
Anyway, great theme and great work! Thanks in advence.
What does this PR change? What problem does it solve?
Limits how many posts will be listed on the home page.
This PR creates a new int variable called
maxPostsOnHomePage
onsite.Params
that will limit how many posts will be listed on the home page.To use it, just add the variable in hugo.yaml as below
Once set, it will only list the N most recent posts. I tested it with Regular and Home-Info modes and it did work as expected.
Was the change discussed in an issue or in the Discussions before?
PR Checklist