Skip to content

Conversation

ebeneliason
Copy link
Contributor

Adds a new script, run via yarn sidebar, capable of generating sidebar.js files for any direcory (or directories) in _docs-sources (or in the output docs directory). It includes support for the category index convention, and supports adding an optional back button. Tests included.

@netlify
Copy link

netlify bot commented Feb 1, 2022

✔️ Deploy Preview for pensive-meitner-faaeee ready!

🔨 Explore the source changes: 25d09f5

🔍 Inspect the deploy log: https://app.netlify.com/sites/pensive-meitner-faaeee/deploys/61fc6e78abe9cb0007f2c1e8

😎 Browse the preview: https://deploy-preview-165--pensive-meitner-faaeee.netlify.app

Copy link
Contributor

@eak12913 eak12913 left a comment

Choose a reason for hiding this comment

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

This looks great! The only thing we should do is to add a small section to the main README to point this new feature out.

@ebeneliason
Copy link
Contributor Author

The only thing we should do is to add a small section to the main README to point this new feature out.

Indeed! That's in the AC, in fact, but I forgot to include it. I'll push another commit, hopefully later today.

@ebeneliason
Copy link
Contributor Author

I've pushed a new README section (and some other minor changes to it), as well as a few additions and fixes in the tests.

eak12913
eak12913 previously approved these changes Feb 3, 2022
Copy link
Contributor

@eak12913 eak12913 left a comment

Choose a reason for hiding this comment

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

LGTM!

The names of the sidebars that get exported from each sidebar.js file
aren't actually relevant, moreover many of them were copy pasted and
used the wrong name. This changes them to the generic "sidebar" or
"sidebars" (for multi-sidebar files) for consistency.
Our deployment guides initially used auto-generated sidebars. Now
that we're leveraging the sidebar files, these are no longer needed.

for (const fullPath of fullPaths) {
if (fs.statSync(fullPath).isDirectory()) {
// process subdirectories recusively (back button is top level only!)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had already called this out explicitly, and yet somehow forgot to omit it in the opts the first time around.

Copy link
Contributor

@eak12913 eak12913 left a comment

Choose a reason for hiding this comment

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

LGTM!

@ebeneliason ebeneliason merged commit 029dec3 into master Feb 4, 2022
@ebeneliason ebeneliason deleted the sidebar-generator branch February 4, 2022 18:57
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.

2 participants