Conversation
…ted changelog The autogenerated changelog.md is gitignored, so repos can't set `displayed_sidebar` frontmatter persistently. Without it, removing the changelog from the sidebar causes Docusaurus to stop rendering any sidebar on the changelog page. Inject `displayed_sidebar` (default: `docs`) into both the full and placeholder changelog frontmatter. The sidebar name is configurable via the new `changelogDisplayedSidebar` theme option for repos whose sidebar is named differently (e.g. apify-sdk-js uses `sidebar`). Refs #2442 https://claude.ai/code/session_01UCp88PBi3QiKXaJVREEqcu
Per review feedback, default `changelogDisplayedSidebar` to undefined instead of `docs`. When undefined, the `displayed_sidebar` field is omitted from the generated changelog frontmatter entirely, letting Docusaurus fall back to its normal sidebar resolution. https://claude.ai/code/session_01UCp88PBi3QiKXaJVREEqcu
|
Preview for this PR was built for commit |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates @apify/docs-theme’s autogenerated changelog.md generation so Docusaurus can render a sidebar on changelog pages even when the changelog is removed from sidebar.js, by injecting displayed_sidebar into the generated frontmatter.
Changes:
- Add a new theme option
changelogDisplayedSidebarand propagate it into changelog generation. - Inject
displayed_sidebarinto frontmatter for both the placeholder changelog and the generated/full changelog. - Refactor markdown frontmatter generation to conditionally include
displayed_sidebarwhen provided.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apify-docs-theme/src/theme.js | Passes configured sidebar ID through changelog generation and adds it to the placeholder changelog.md frontmatter. |
| apify-docs-theme/src/markdown.js | Extends frontmatter generation to optionally include displayed_sidebar, and threads the option through updateChangelog(). |
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.
Removing the changelog from the
sidebar.jscauses Docusaurus to stop rendering any sidebar on the changelog page. This breaks the visual layout of the docs (see conversation here).Inject
displayed_sidebarinto both the full and placeholder changelog frontmatter. The sidebar name is configurable via the newchangelogDisplayedSidebartheme option for repos whose sidebar is named differently (e.g., apify-sdk-js usessidebar).Closes #2442