Skip to content

Add Post Navigator setting for Blog Posts #119

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

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

Conversation

hgp22
Copy link

@hgp22 hgp22 commented Jun 9, 2025

This feature implements an opt-in component that, when enabled, adds a navigator at the end of each blog post; so that the users are not forced to go back to the /blog page after reading each post.

It implements the feature mentioned in #118

Explanation for the Setting Placement

I decided to put this feature under params in the hugo.toml file, given that it is similar to hideMadeWithLine.

Implementation

The component in question follows the same strategies as the rest of the code:

  • the new feature is in layouts/partials/post_navigator.html
  • and it's implemented in layouts/partials/single.html

Final Note

I’ve added a summary of this feature in both the README.md and hugo.toml files. Additionally, I’ve included a brief explanation in the Development section to clarify how a developer should execute hugo commands from the root directory of this project.

I’m open to any changes or discussions.

@janraasch janraasch requested review from janraasch and Copilot June 12, 2025 11:41
Copilot

This comment was marked as outdated.

Co-authored-by: Copilot <[email protected]>
@janraasch janraasch requested a review from Copilot June 17, 2025 11:50
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a new Post Navigator feature for blog posts, allowing users to navigate directly to adjacent posts without having to return to the blog listing.

  • Introduces a new partial (post_navigator.html) that conditionally renders navigation links for blog posts.
  • Integrates the new partial into the single post layout and updates configuration and documentation to support the feature.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
layouts/partials/post_navigator.html Adds the navigator component, with inline styling and conditional display logic.
layouts/_default/single.html Inserts the new post navigator partial into the single post layout.
exampleSite/hugo.toml Documents the new enablePostNavigator setting in configuration comments.
README.md Updates documentation explaining how to enable and test the post navigator.

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.

1 participant