Skip to content

[docs] Sort the pages by path and ignore dashes#10396

Merged
oliviertassinari merged 1 commit into
mui:v1-betafrom
TeamWertarbyte:api-sorting
Feb 21, 2018
Merged

[docs] Sort the pages by path and ignore dashes#10396
oliviertassinari merged 1 commit into
mui:v1-betafrom
TeamWertarbyte:api-sorting

Conversation

@leMaik
Copy link
Copy Markdown
Collaborator

@leMaik leMaik commented Feb 21, 2018

This PR changes the page list generation code to explicitly sort the pages by pathname, ignoring dashes.

Fixes #10388

@leMaik leMaik added the docs Improvements or additions to the documentation. label Feb 21, 2018
@oliviertassinari oliviertassinari merged commit bce6ebd into mui:v1-beta Feb 21, 2018

// sort by pathnames without '-' so that e.g. card comes before card-action
pages.sort((a, b) => {
const pathnameA = a.pathname.replace(/-/g, '');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ideally, we should have been ignoring the .js extension:

> ['card-action', 'card'].sort()
["card", "card-action"]

But it's working, so let's 🚢 .

@leMaik leMaik deleted the api-sorting branch February 26, 2018 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to the documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants