-
Notifications
You must be signed in to change notification settings - Fork 4
Add links to top-level sidebar categories #143
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
Conversation
Amplify deployment status
|
Reviewer note: eventually we can convert |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without having too much context here, it looks fine. however, there is that big warning about something wrong with the regex. could you check it out before merginig.
server/config-docs.ts
Outdated
if (category.entries.some((e) => e.slug.match(categoryDirPattern)[2] == "")) { | ||
return "index"; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this this index [2]
guaranteed to exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My impression was that the caller would always supply a valid slug, but I should prevent bad inputs anyway—I've added better exception handling and some tests in 2ad40d7
Contributes to #87 Top-level sidebar categories do not have links, meaning that when a user clicks a sidebar category, it expands, but does not take the user to a category index page as they might expect. Category index pages are listed as regular pages among other regular pages (another change will handle the redundant menu page sidebar listings). This change edits the code that converts the `config.json` configuration file into a Docusaurus navigation config. It adds a Docusaurus `link` to each top-level navigation category based on the root path segment shared by all slugs within the category.
- Remove unnecessary double negation. - Add an escape character to `categoryDirPattern` - Handle invalid entry slugs and add tests for invalid `getIndexPageID` cases
d1fd7e8
to
2ad40d7
Compare
Contributes to #87
Top-level sidebar categories do not have links, meaning that when a user clicks a sidebar category, it expands, but does not take the user to a category index page as they might expect. Category index pages are listed as regular pages among other regular pages (another change will handle the redundant menu page sidebar listings).
This change edits the code that converts the
config.json
configuration file into a Docusaurus navigation config. It adds a Docusauruslink
to each top-level navigation category based on the root path segment shared by all slugs within the category.