curtiscde / hugo-theme-massively

Massively theme for Hugo static site generator
https://hugo-theme-massively.netlify.app
Other
155 stars 138 forks source link

Blog Posts Date / 'Rating' Ordering - Pagination #89

Closed WillNaylor1994 closed 1 year ago

WillNaylor1994 commented 4 years ago

Hi There

First of all, this is an awesome theme! I've now almost created my entire blog on here, i did some tests depolying to netlify and it looks great. Good job!

I've added shortcode html to allow me to put in iframe links for google maps, and also add videos etc into the markdown files. This also all works fine.

The only thing i cannot get right with your theme, is the blog posts ordering (espeically when it comes to pagination)

If i have all the posts on one page (about 30 posts) then i can order them perfectly by using the 'sort by rating'. This way each post can have whatever date it wants, and still be ordered however i choose.

This is excellent, but seems to fall apart when it comes to Pagination. I have the 30 blog posts split between 4 pages. Now the posts are all on page1,2,3,4 they start to not behave the same way when using the 'sort by rating' tactic instead of date.

Has anyone else had this problem / tackled it? any ideas would be very welcome!

Thanks all.

WillNaylor1994 commented 3 years ago

I thought i should leave the answer to this query here as this has been solved.

In index.html line 29 you need to change something.

from this:

{{ $postsPaging := .Paginate $postsForPaging $postsPageSize }}

To this:

{{ $postsPaging := .Paginate $postsForPaging.ByDate $postsPageSize }}