Pinning Posts (aka "Sticky" posts) In fastpages

Pinning A Blog Post In Fastpages

By default, posts are sorted by date on your homepage. However you may want one or more blog posts to always appear at the very top of your homepage. In otherwords, you may want certain posts to be “pinned” or “sticky”. To accomplish this, specify the sticky_rank front matter in the order you would like your sticky posts to appear. Blog posts that do not set this parameter are sorted in the default way by date after the sticky posts.

For example, consider these three markdown posts

2020-01-01-Post-One.md

---
title: Post One
sticky_rank: 1
---

2020-02-01-Post-Two.md

---
title: Post Two
sticky_rank: 2
---

2020-04-01-Post-Three.md

---
title: Post Three
---

However, since sticky_rank is specified, blog posts will first be sorted by sticky_rank in ascending order, then by date in descending order, so the order of these posts will appear like so:

  • Post One

  • Post Two

  • Post Three

Note: without sticky_rank the above posts would actually be sorted in reverse order due to the dates associated with each post.

This is enabled on fastpages versions 2.1.15 and greater. You can upgrade to get this functionality.

5 Likes