Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Pinned Posts #40

Open
coignard opened this issue Oct 14, 2024 · 0 comments
Open

Add Support for Pinned Posts #40

coignard opened this issue Oct 14, 2024 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@coignard
Copy link
Owner

There is need to implement the ability to mark blog posts as "pinned." Pinned posts should always appear at the top of the list on the homepage and within their respective categories.

Tasks:

  1. Update Post Class:

    • Add a isPinned property to the Post class.
    • Implement a isPinned() method to check if a post is pinned.
  2. Modify Post Creation Logic:

    • Update the createFromFile method in the Post class to detect and assign the isPinned property based on filenames that start with +.
  3. Sorting Logic:

    • Modify sorting logic within the PostCollection class to ensure pinned posts always appear at the top of any list.
  4. Adjust Controllers:

    • Ensure that methods fetching the latest posts (like for /latest/) exclude pinned posts from being selected as the "latest" post.
  5. UI/UX Consideration:

    • Consider how pinned posts will be visually differentiated from non-pinned posts on the frontend display.

Acceptance Criteria:

  • A post is considered pinned if its filename begins with a +.
  • Pinned posts always appear at the top of their respective lists.
  • The logic for fetching the latest post (e.g. for /latest/) should not include pinned posts in determining the latest item.
@coignard coignard added the help wanted Extra attention is needed label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant