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: resolve unlinked content #11391

Merged
merged 3 commits into from
Apr 22, 2021
Merged

website: resolve unlinked content #11391

merged 3 commits into from
Apr 22, 2021

Conversation

zchsh
Copy link
Contributor

@zchsh zchsh commented Apr 18, 2021

This PR fixes an issue where pages that were previously not included in *-nav-data.json files were not rendered.

This PR introduces a temporary fix to ensure these pages are rendered, but are not shown in the sidebar navigation, to match previous behaviour. We plan to revisit this issue more intentionally in the near future, once the Vault branding PR lands.

This PR also introduces a hotfix for brand-related link coloration issues in docs-sidenav. On the live site, the "active" sidebar item is not clearly highlighted; with this fix in place, we use our brand blue color to ensure the highlight is visible (and to match a similar hotfix, see style.css for details).

Affected Pages

api

docs

guides

Note: this content should likely be removed as these URLs redirect to Learn, and since the broader Guides area of the site is no longer linked to in navigation. For now, these items have simply been added back to guides-nav-data.json.

@vercel vercel bot temporarily deployed to Preview – vault-storybook April 18, 2021 02:14 Inactive
@zchsh zchsh changed the title [ WIP, DO NOT MERGE ] website: fix missing pages [ WIP ] website: resolve unlinked content Apr 21, 2021
@vercel vercel bot temporarily deployed to Preview – vault-storybook April 21, 2021 21:19 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook April 21, 2021 21:20 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook April 21, 2021 21:21 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook April 22, 2021 14:35 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook April 22, 2021 16:42 Inactive
@zchsh zchsh changed the title [ WIP ] website: resolve unlinked content website: resolve unlinked content Apr 22, 2021
@zchsh zchsh marked this pull request as ready for review April 22, 2021 16:49
@@ -0,0 +1,148 @@
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.

I've added this check as a bit of a hotfix as well. Happy to remove if we feel like we're better off without it - I suspect we'll ultimately want to perform this check in docs-page (similar to what we do with validateFilePaths).


/**
* DEBT
* This is a short term hotfix for "hidden" docs-sidenav items.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hopefully this comment covers the context here - once we come up with an alternate solution (eg a modification to docs-page/server.js or to docs-sidenav or something), I think this will be relatively straightforward to switch back out.

With that in mind, I think this same solution can be applied to other sites where unlinked content is an issue.

@@ -0,0 +1,20 @@
[
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 api-docs and docs routes seemed appropriate to continue to keep hidden, to match previous behaviour. I've used the _temp-enable-hidden-pages fix to allow this.

Idea here is it'll be easy to keep track of "hidden" pages during this temporary fix stage, since they're in a separate nav-data.json file. And easy to move into the proper "visible" nav-data.json file if any of these pages should actually be visible in the sidebar.

},
{
"title": "Performance Standby Nodes",
"path": "operations/performance-nodes"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

/guides is already hidden / unlinked from main navigation, so rather than add another layer of complexity here, I've just added the missing pages.

Should note as well that all these paths redirect to Learn anyways. But felt that the deletion of guides content probably merits a separate PR, and should probably be done all at once for clarity.

.g-docs-sidenav {
--brand: var(--vagrant) !important;
--brand-text: var(--vagrant) !important;
}
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 is very similar to the override above - we're in a bit of a transient branding stage, and with Vault specifically the --brand colors actually cause quite a few issues. There is a "debt" comment just above here that I'm rolling this change into.

In this specific case, the --brand value for vault is gray by default, so "active" sidebar items, which should appear highlighted, are really hard to pick out.

This change is kind of unrelated to the "unlinked pages" issue; I've added it in because it felt important to patch for UX purposes.

@jescalan jescalan added docs-cherrypick docs website Code changes specifically for the docs website labels Apr 22, 2021
@jescalan jescalan merged commit 20492a1 into hashicorp:master Apr 22, 2021
@zchsh zchsh deleted the zs.fix-missing-pages branch April 22, 2021 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs website Code changes specifically for the docs website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants