Skip to content

Skip the navigation item if the parent group points to the same file#707

Merged
reakaleek merged 1 commit into
mainfrom
feature/repeated-entries-in-navigation
Mar 10, 2025
Merged

Skip the navigation item if the parent group points to the same file#707
reakaleek merged 1 commit into
mainfrom
feature/repeated-entries-in-navigation

Conversation

@reakaleek

@reakaleek reakaleek commented Mar 10, 2025

Copy link
Copy Markdown
Member

Closes #443

Copilot AI review requested due to automatic review settings March 10, 2025 13:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR Overview

This PR updates the navigation rendering logic in the _TocTreeNav.cshtml view so that a navigation item is skipped if its parent group points to the same file.

  • Updated condition in the FileNavigation check to compare file names.

Reviewed Changes

File Description
src/Elastic.Markdown/Slices/Layout/_TocTreeNav.cshtml Modified the condition to skip a navigation item if its file name matches the parent index file name.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

src/Elastic.Markdown/Slices/Layout/_TocTreeNav.cshtml:11

  • [nitpick] The naming of the variable 'file' and its property 'File' can be confusing. Consider using more descriptive names to improve code clarity.
if (item is FileNavigation file && Model.SubTree.Index?.FileName != file.File.FileName)

@reakaleek reakaleek requested a review from a team March 10, 2025 13:57
@reakaleek reakaleek self-assigned this Mar 10, 2025
@reakaleek reakaleek added the fix label Mar 10, 2025
@reakaleek reakaleek enabled auto-merge (squash) March 10, 2025 14:09
@reakaleek reakaleek merged commit 6a91063 into main Mar 10, 2025
@reakaleek reakaleek deleted the feature/repeated-entries-in-navigation branch March 10, 2025 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Repeated entries in navigation

3 participants