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

feat: add prev/next links at the bottom of blog post #372

Merged
merged 2 commits into from
Sep 16, 2024

Conversation

satnaing
Copy link
Owner

@satnaing satnaing commented Sep 8, 2024

Add Prev Post and Next Post links at the bottom of a blog post.

Desktop

image

Mobile

image

Resolves #358

@satnaing satnaing closed this Sep 11, 2024
@satnaing satnaing deleted the feat/add-prev-next-post-links-in-blog-post branch September 11, 2024 02:22
@satnaing satnaing restored the feat/add-prev-next-post-links-in-blog-post branch September 11, 2024 02:22
@satnaing satnaing reopened this Sep 11, 2024
Copy link
Contributor

@barnett617 barnett617 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@barnett617
Copy link
Contributor

LGTM

I find something maybe @satnaing you should take into consideration which is once a post page can navigate to sibling post pages, the "Go back" button behavior may be redesigned.
Because if you change to a new page by using prev/next link, the "Go back" will take you to the last post page rather than back to Posts page.
This may seems wired because you can be more hard to back to Posts page until you back to the first post page you clicked from Posts.

@satnaing
Copy link
Owner Author

Good point! @barnett617
I'll look into it after #376 since merging this PR will affect that PR.

@satnaing satnaing force-pushed the feat/add-prev-next-post-links-in-blog-post branch from 0f87f6d to dd07c2e Compare September 16, 2024 13:39
@satnaing satnaing merged commit 29eff36 into main Sep 16, 2024
3 checks passed
@satnaing satnaing deleted the feat/add-prev-next-post-links-in-blog-post branch September 16, 2024 13:43
@satnaing
Copy link
Owner Author

I find something maybe @satnaing you should take into consideration which is once a post page can navigate to sibling post pages, the "Go back" button behavior may be redesigned.
Because if you change to a new page by using prev/next link, the "Go back" will take you to the last post page rather than back to Posts page.
This may seems wired because you can be more hard to back to Posts page until you back to the first post page you clicked from Posts.

At the moment, I'll just leave the "Go back" behavior as it is.
Unlike other buttons (or links), "Go back" button behavior is a bit complicated since a blog post can be navigated from "Posts page", "Home page", "Tag page" and "Search page".
So, it's not very ideal to Go back to the "Posts page" whenever "Go back" button is clicked. Plus, users can go to "Posts page" by clicking the "Posts" in the nav bar too.
Current implementation is to "Go back" to the previous page using browser's history API.
Probably a breadcrumb is a good fit in this case. I'm not sure tho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Add previous and next posts
2 participants