newsroom icon indicating copy to clipboard operation
newsroom copied to clipboard

Pinned post?

Open davisaqueen opened this issue 3 years ago • 1 comments

Is it possible to set a pinned post to always show first of all blog posts? Now you sort option based on date, but how can I pin one post on top of other posts?

davisaqueen avatar Apr 29 '21 11:04 davisaqueen

For future reference and those that might want to go for a similar approach here's what I did:

  • Used the weight page parameter which is part of Hugo for sorting: https://gohugo.io/variables/page/ and can now order posts anyway I like based on the weight value
    • Posts I want to show off first get a low weight, while others get pushed back by a higher weight value
  • You can use the date to craft a weight value if you want a single post pinned

Not sure if it's too late, but that helped me going for a similar objective, and hope it helps those looking for a quick solution.

osV22 avatar Jun 26 '21 06:06 osV22