Add sidebar.yml generation script for shopify-dev docs#3508
Open
Add sidebar.yml generation script for shopify-dev docs#3508
Conversation
Adds a reusable Node.js script that generates sidebar.yml files for shopify-dev from the generated_docs_data.json output. This replaces manual sidebar editing when adding new calver versions. The script groups entries by category/subCategory, sorts alphabetically, and produces YAML matching the shopify-dev convention. It validates input data and fails clearly if the schema has changed.
Contributor
|
Oxygen deployed a preview of your
Learn more about Hydrogen's GitHub integration. |
fredericoo
reviewed
Feb 26, 2026
Contributor
There was a problem hiding this comment.
we can make this a ts file and run it with node --experimental-strip-types generate-sidebar.ts or even without the flag in node 24.
would also advocate in favour of creating a command in the root package.json to make it more discoverable. it can build docs → generate sidebar
when are we expected to run this? is this automated? id love some more context
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docs/generate-sidebar.cjs) that generatessidebar.ymlfiles for the shopify-dev repoUsage
# After building docs (build-docs.sh), generate the sidebar: node docs/generate-sidebar.cjs hydrogen 2025-10 \ packages/hydrogen/docs/generated/generated_docs_data.json \ /path/to/shopify-dev/content/api/hydrogen/2025-10/sidebar.ymlHow it works
generated_docs_data.json(the build output)category→subCategoryhydrogen_2025_10) and URL pathsTest plan
🎩 you can see this PR where I used it