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

Docs: 404 page update #465

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open

Docs: 404 page update #465

wants to merge 22 commits into from

Conversation

mmcallister
Copy link
Contributor

This is for issue #188

The 404 page in Docs needs some work.

Docs
https://goteleport.com/docs/blah/

vs

Website
https://goteleport.com/blah/

@mmcallister mmcallister added documentation Improvements or additions to documentation enhancement New feature or request labels May 17, 2024
@mmcallister mmcallister self-assigned this May 17, 2024
Copy link

vercel bot commented May 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 26, 2024 7:58pm

ptgott and others added 18 commits August 26, 2024 14:48
Closes gravitational/teleport#15061

We want to encourage a more textual approach to the docs. Add this as a
general goal to the style guide. If ther eare specific violations of
this style suggestion that we want to address with documentation
efforts, linters, etc., we can plan these separately.
* added javascript to handle version links

* lint fix

---------

Co-authored-by: Steven Martin <[email protected]>
- Update config.json
- Add a submodule for v17
- Update .gitmodules
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](micromatch/braces@3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Add a `config.json` field within each `navigation` entry called
`generateFrom`. This designates a relative path from `docs/pages` from
which to generate entries within the sidebar.

When generating pages, a function called `generateNavPaths` looks for
pages to use as second-level section introductions. As with the
Docusaurus convention, second-level section introductions have the same
name as their parent directory.

Adding a `generateFrom` field is consistent with the Docusaurus
approach to sidebar generation, in which a configuration field indicates
which directory to generate a section from. This gives us control over
the title and icons we use for navigation sections, which aren't
available to fetch from a directory tree alone. It also lets us use the
current, hardcoded `entries` approach for some sections if we need to.

Also un-skips some accidentally skipped tests.
Improve the sidebar generator to accommodate the reorganized docs site.

- Alphabetize auto-generated sidebar entries.

  The exception is any page that includes "Introduction" or
  "introduction" in the title. Elevate these to the first entry to avoid
  a confusing sidebar order.

- Show third-level category pages in the sidebar without showing their
  contents. This way, we can add content one level beyond the level
  permitted in the sidebar while still showing the category page for
  that content in the sidebar.

- Allow for a category page to be at the same level as its associated
  subdirectory. This is to accommodate the Terraform Provider reference
  which, because of the way it's generated, can only include a category
  page outside of its associated subdirectory. This does not abide by
  the Docusaurus convention, so we will need to figure out a solution
  eventually, but this is a quick alternative to tide us over.

- Only add ".mdx" files to the sidebar. Otherwise, the generator
  attempts to add vim swapfiles etc.
As we reorganize the documentation, it becomes cumbersome to manually
change lists of links to pages within the documentation, e.g., in table
of contents pages for subsections of the docs. This change adds a remark
plugin for generating a list of links to pages in the current directory.

The plugin works similarly to `remark-includes`, and accesses the local
filesystem during the docs build. It replaces any lines consisting of
`(!toc!)` with a list of links to pages in the current directory. The
assumption is that a category page within a directory can use this to
list contents.
Updating description requirements
Currently, the code that generates the navigation sidebar from a
directory tree stops at the second level of a given top-level section.
However, some sections include three levels of content. This change
edits the sidebar generator so it works recursively.

Also fix an issue with the `DocsNavigationItems` component that prevents
the docs site from highlighting sidebar entries past two levels of
depth. The component treats a sidebar subsection as "active" if one of
its entries is equivalent to the current page path.

But if the current page path is a grandchild of a sidebar subsection,
this means that the component hides the grandchild, since none of the
children of the subsection is equivalent to the current page. This
change determines that a sidebar subsection is "active" if the selected
path _starts with_ the subsection path.

Also edit the CSS padding of navigation links to depend on the current
level of the navigation menu. This allows for indentation of submenu
links beyond the second level.
@mmcallister mmcallister marked this pull request as ready for review August 28, 2024 20:02
@avatus
Copy link
Contributor

avatus commented Aug 28, 2024

This looks like a bunch of extra commits got dragged in on accident. Could you take a look?

Copy link
Contributor

@benarent benarent left a comment

Choose a reason for hiding this comment

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

also a lot of conflicts, can you fix those first

@mmcallister
Copy link
Contributor Author

@travelton when you have bandwidth can you have a look too? The commits look relevant and the conflicts minor, as this issue has been open for awhile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants