Creating a pinned post home page for Bulletin or Digest themes without hacking home.hbs

I like the way that the Digest and Bulletin themes show a single post on the home.hbs template.

What I’d like is a “pinned post” that users see when they hit that page, rather than the latest article.

Looking into the code, it wouldn’t be too hard to do by hacking on the template. But if there’s any way to avoid this, for the sake of not having to maintain a separate repo, I’d like to do that.

Is there any way to make this work with routing, maybe with a featured post or tag, that won’t involve editing the home.hbs file?

Thanks!

May be I can help you. If you would like to have my service, please let me know.

I was going to say you’ll need to edit the theme for this, but there is one way to do this with routing.

  1. You’ll need to make the pinned post featured in the editor.
  2. Update your routes.yaml file like this:
routes:

collections:
  /:
    permalink: /{slug}/
    template: index
    order: featured desc, published_at asc

taxonomies:
  tag: /tag/{slug}/
  author: /author/{slug}/

This will put your featured post at the beginning of the order of your posts like a pinned post!

Works as advertised. Thanks for that Ryan.

1 Like