royalfig / smart

A theme for the open source publishing platform Ghost

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FEATURE REQUEST: Add featured post section to homepage

srenslow opened this issue · comments

Hi @royalfig,

As a user, I want to display a section on the homepage to display featured posts. Potential ideas:

  • A section titled below the hero area that will pull from the Ghost tag "Feature this post"
  • the ability to add/modify the title of the section
  • able to toggle this section on/off from the Ghost design page (nice to have for folks that don't want it)

The general sentiment is to have an area for writers who want to feature essays on the homepage they'd like to get some eyes on so they get buried in the archives. Some themes in Ghost portfolio that are more substack/newsletter-looking (like Dawn) have something along these lines.

Thanks for the suggestion!

This is feasible but will take more work than it might seem because it requires conditional logic all the way down—not only for whether someone wants this feature or not, but also to conditionally show/not show those featured posts for each section.

I'll test out some things, but it's not trivial to implement.

One way to kind of achieve this would be to use custom routing:

## routes.yaml

routes:

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

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

This custom route will pull any post you mark as featured to the top of the collection.

got it, makes sense! Thanks for the routes suggestion too, I'll give it a shot!

I played around with adding this to the homepage, but it would require a bit too much moving things around at the moment. As an intermediary step, I did add a flame icon to all featured posts in #286,

I'm going to close this for now, but I'll revisit it in the future.