Skip to content
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

website: support hidden pages in nav-data #10180

Merged
merged 5 commits into from
May 6, 2021
Merged

website: support hidden pages in nav-data #10180

merged 5 commits into from
May 6, 2021

Conversation

zchsh
Copy link
Contributor

@zchsh zchsh commented May 4, 2021

πŸ‘€ Preview
🎟️ Asana task

This PR is a follow-up to #10087, and implements a more permanent and clean solution for "hidden" pages, via updates to our docs-page component.


Items in nav-data.json now support an optional "hidden": true property, which will hide the item (and any descendants) from the docs sidebar.

Alongside this change, all .mdx files in each content folder must be included in the corresponding nav-data file. The changes to docs-page included an automated check which will throw an error during the website build process if there are any unlinked content files.

@hashicorp-ci
Copy link
Contributor

πŸ€” This PR has changes in the website/ directory but does not have a type/docs-cherrypick label. If the changes are for the next version, this can be ignored. If they are updates to current docs, attach the label to auto cherrypick to the stable-website branch after merging.

@@ -1,147 +0,0 @@
var fs = require("fs");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This check is no longer needed, it has been implemented in our docs-page component as part of react-components#220.

@@ -1,85 +0,0 @@
// Imports below are used in server-side 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.

This was a temporary hot fix for hidden pages, has been replaced by changes in react-components#220.

@@ -1,6 +0,0 @@
[
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The *-nav-data-hidden.json files were part of the temporary solution, so removing them. These nav-data items have been added to the proper nav-data file, with the "hidden" prop in place to reflect current state.

@@ -12,7 +12,7 @@
"@hashicorp/react-call-to-action": "3.0.1",
"@hashicorp/react-callouts": "7.0.2",
"@hashicorp/react-content": "7.0.1",
"@hashicorp/react-docs-page": "13.1.4",
"@hashicorp/react-docs-page": "13.1.7-alpha.10",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will bump this to a stable release once these PRs are finalized and hashicorp/react-components#220 is merged and published.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

βœ… Bumped to stable

@zchsh zchsh marked this pull request as ready for review May 5, 2021 14:22
@vercel vercel bot temporarily deployed to Preview – consul-ui-staging May 5, 2021 21:19 Inactive
@brkalow brkalow added pr/no-changelog PR does not need a corresponding .changelog entry type/docs Documentation needs to be created/updated/clarified type/docs-cherrypick labels May 5, 2021
Copy link
Contributor

@brkalow brkalow left a comment

Choose a reason for hiding this comment

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

Excellent

@kylemac kylemac merged commit adfaf29 into hashicorp:master May 6, 2021
@zchsh zchsh deleted the zs.support-hidden-pages branch May 6, 2021 17:36
kylemac pushed a commit that referenced this pull request May 6, 2021
* website: bump to docs-page prerelease with hidden page support

* website: replace hidden pages hot fix for /docs, /api-docs, and /commmands

* website: remove unused files for old hidden pages hotfix

* website: bump to stable docs-page, w next-mdx-remote bump

* website: bump to latest markdown-page
@hc-github-team-consul-core
Copy link
Collaborator

πŸ’ If backport labels were added before merging, cherry-picking will start automatically.

To retroactively trigger a backport after merging, add backport labels and re-run https://circleci.com/gh/hashicorp/consul/364837.

@hc-github-team-consul-core
Copy link
Collaborator

πŸ’βŒ Cherry pick of commit adfaf29 onto stable-website failed! Build Log

@hc-github-team-consul-core
Copy link
Collaborator

πŸ’βœ… Cherry pick of commit adfaf29 onto release/1.10.x succeeded!

hc-github-team-consul-core pushed a commit that referenced this pull request May 6, 2021
* website: bump to docs-page prerelease with hidden page support

* website: replace hidden pages hot fix for /docs, /api-docs, and /commmands

* website: remove unused files for old hidden pages hotfix

* website: bump to stable docs-page, w next-mdx-remote bump

* website: bump to latest markdown-page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/no-changelog PR does not need a corresponding .changelog entry type/docs Documentation needs to be created/updated/clarified
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants