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

Top-level category index pages appear twice in the sidebar #87

Open
ptgott opened this issue Dec 27, 2024 · 2 comments
Open

Top-level category index pages appear twice in the sidebar #87

ptgott opened this issue Dec 27, 2024 · 2 comments

Comments

@ptgott
Copy link
Contributor

ptgott commented Dec 27, 2024

The sidebar displays top-level category index pages as entries within their respective categories. For example, the section of the sidebar for "Admin Guides" includes the "Teleport Admin Guides" page as a page within the category, when it should be the page that readers visit when they click "Admin Guides".

Image

Fix the docs site configuration so that clicking top-level categories on the sidebar navigates to the relevant index page.

@ptgott
Copy link
Contributor Author

ptgott commented Jan 3, 2025

The sidebar generator is in node_modules/@docusaurus/plugin-content-docs/lib/sidebars/generator.js. What's strange is that, if I add the following console log to the end of the file...

     const docs = getAutogenDocs();
     const fsModel = treeify(docs);
+    console.log("fsModel", JSON.stringify(fsModel, undefined, 2));
     const sidebarWithPosition = generateSidebar(fsModel);
     const sortedSidebar = sortItems(sidebarWithPosition);
     return sortedSidebar;

The fsModel does contain the intended category index pages, but does not assign them entries. You can see this with reference.mdx in the output snippet below:

fsModel {
  "backends.mdx": "reference/backends",
  "cloud-faq.mdx": "reference/cloud-faq",
  "config.mdx": "reference/config",
  "join-methods.mdx": "reference/join-methods",
  "networking.mdx": "reference/networking",
  "predicate-language.mdx": "reference/predicate-language",
  "reference.mdx": "reference/reference",
  "resources.mdx": "reference/resources",
  "signals.mdx": "reference/signals",
  "signature-algorithms.mdx": "reference/signature-algorithms",
  "user-types.mdx": "reference/user-types",
  "access-controls": {
    "access-controls.mdx": "reference/access-controls/access-controls",
    "access-lists.mdx": "reference/access-controls/access-lists",
    "authentication.mdx": "reference/access-controls/authentication",
    "login-rules.mdx": "reference/access-controls/login-rules",
    "roles.mdx": "reference/access-controls/roles",
    "saml-idp.mdx": "reference/access-controls/saml-idp"
  },
// [...]

@ptgott
Copy link
Contributor Author

ptgott commented Jan 6, 2025

I propose we:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant