Skip to content

Commit

Permalink
chore: add changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
DavieReid committed Nov 2, 2023
1 parent 649d959 commit 5c83b60
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .changeset/ninety-coins-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
'@jpmorganchase/mosaic-plugins': patch
'@jpmorganchase/mosaic-site': patch
---

## Feature - Advanced Sidebar Sorting

Given a directory of pages, you can provide a sidebar sort config in the frontmatter of the directory index page which will be used to sort the other pages in the directory.

The sort config consists of:

- field: the path, separated by a '/', to the page metadata you want to use for sorting e.g. title or data/publicationDate
- dataType: 'string' or 'number' or 'Date'
- arrange: 'asc' or 'desc'

Note that a page can still specify its sidebar priority and this will overrule any sort config specified in the index page.

## Example

Let's say you have a "Newsletters" directory which has an index page and multiple newsletter pages in the same directory.

Each newsletter page has a data property which includes the publication date of the newsletter.

To order the newsletters in the sidebar in descending order (the newest newsletter first):

Add the following to the **index** page frontmatter:

```
sharedConfig:
sidebar:
sort:
field: data/publicationDate
dataType: date
arrange: desc
```

1 comment on commit 5c83b60

@vercel
Copy link

@vercel vercel bot commented on 5c83b60 Nov 2, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

mosaic – ./

mosaic-mosaic-dev-team.vercel.app
mosaic-git-main-mosaic-dev-team.vercel.app

Please sign in to comment.