docusaurus-openapi-docs icon indicating copy to clipboard operation
docusaurus-openapi-docs copied to clipboard

Question: How to render Sidebar Menu on a custom page

Open kossmokvin opened this issue 1 year ago • 1 comments

Greeting! I would like to render the 'openapi-sidebar-default' sidebar menu on a custom page. But I am unable to import the apiMetadata on a custom page. Any help would be greatly appreciated.
Thank you in advance!

kossmokvin avatar Aug 14 '24 19:08 kossmokvin

I'm not precisely sure what you mean by "custom page." Is that referring to a file located inside the /src/pages directory? If so, those pages don't have sidebars.

The next question I'd have for you is what do you mean by openapi-sidebar-default? You can specify which sidebar is displayed on a given doc using the frontmatter:

---
title: Custom Sidebar Here
displayed_sidebar: 'openapi-sidebar-default'
---

This doc will display the specified sidebar, even if it's not a doc _in_ the sidebar.

All that said, this openapi plugin doesn't really mess with your already-configured sidebars. So, if you want to display those sidebars you may need to do some configuring. Check out this page for some details on that.

ElliotFriend avatar Aug 15 '24 18:08 ElliotFriend