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

fix: PRSDM-5064 Add sorting by file path order in ascending/descending #7

Merged
merged 2 commits into from
Nov 28, 2024

Conversation

christopherbrunsdon
Copy link
Contributor

Introduced functionality to sort articles, navigation items, and pages by file path in both ascending and descending order based on configuration. Updated partial templates to respect sortByFilePath parameter, providing more flexibility in content presentation.

Description

  • Add sorting direction by file path.
  • Allow sorting direction to be defined at path level by setting it in the frontmatter:

eg:

---
title: Updates
sortByFilePath: "desc"
---

Issue

Screenshots

image

PR Readiness Checks

  • Your PR title conforms to conventional commits <type>: <jira-ticket-num><title>, for example: fix: PRSDM-123 issue with login with a maximum of 100 characters
  • You have performed a self-review of your changes via the GitHub UI
  • Comments were added to new code that can not explain itself (see reference 1 and reference 2)
  • New code adheres to the following quality standards:

Introduced functionality to sort articles, navigation items, and pages by file path in both ascending and descending order based on configuration. Updated partial templates to respect `sortByFilePath` parameter, providing more flexibility in content presentation.
Copy link
Contributor

@Zalaras Zalaras left a comment

Choose a reason for hiding this comment

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

Looks good otherwise, haven't tested locally

layouts/partials/navigation/nav-item.html Outdated Show resolved Hide resolved
Implemented a new partial template for determining sort order, which centralizes logic previously duplicated across various parts of the codebase. This change simplifies code maintenance and enhances consistency by ensuring all components use the same method to decide the sort order.
Copy link
Collaborator

@Quantumplate Quantumplate left a comment

Choose a reason for hiding this comment

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

Works nicely.
Great job @christopherbrunsdon

@Quantumplate Quantumplate merged commit 6abb49a into main Nov 28, 2024
1 check passed
@Quantumplate Quantumplate deleted the PRSDM-5065-updates-section-ordering-fix branch November 28, 2024 12:18
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.

3 participants