Skip to content
This repository has been archived by the owner on Mar 7, 2018. It is now read-only.

"Fresh Posts" feature #42

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jmonegro
Copy link

In order to improve discovery, I experimented with adding a "Fresh Post" feature, where a new post will be bumped to the top of the feed if it is "Fresh".

A fresh post is the last one that has been submitted within the past hour, and is not a featured post. It also adds a temporary class called post-fresh to the view, in order to facilitate custom styling.

This method gets the #{quantity} latest posts submitted within the past #{hours}. By default, it returns a post (dubbed "Fresh") if it is new, not featured, and was submitted within the past hour.
Using the new get_fresh_posts method, the posts list will add the latest post to the top of the feed if it is not featured, today is the current day, and it was submitted within the last hour.
The feed returned by posts.py now includes "Fresh Posts". Updated the template to add post-fresh to a post if it is fresh, to facilitate styling.
The last post from the regular feed should only be hidden/removed if there is (and it is) a fresh post.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant