Adding custom component to every docs page #7900
Replies: 4 comments 11 replies
-
|
Nevermind, I was poking around in the community plugins and figured out the answer. |
Beta Was this translation helpful? Give feedback.
-
By default, all our theme components are marked as unsafe (until we are ready to mark them as safe). I wouldn't worry too much, it's just a way for us to signal that we may do breaking changes on their APIs. The word "unsafe" is probably a bit too strong and frightening here, we'll look into a way to make it less scary in the future.
You can create a theme with just your reusable components, and use a You can as well use a monorepo and have a |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @slorber! I have a question in StackExchange with a problem I'm having in trying to go the reusable component route. Mind taking a look please? |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the suggestions @slorber and @RDIL! They helped tremendously. Attached is a working proof of concept for what I'm trying to do. Pull the file, unzip it, then run these commands:
(I know I can script all that, I'm trying to keep this as bare-bones as possible) Seems that either A) upgrading yarn to latest or B) switching to a workspace did the trick. If I could get thoughts and opinions on if there are more appropriate avenues to achieve what I'm trying to do I'd appreciate it. But basically what's currently the RocketTOC component will end up being a dynamically generated list of results from an API call using the array returned by |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I'm trying to add a custom component directly under the table of contents. The custom component will do some AJAX calls to an internal API and display a short list of results.
I figured out how to swizzle/wrap the TOC component and that works fine.
I have two questions with this approach though:
I suspect the answer to # 2 is to write a custom plugin but the docs aren't quite clear if I should create a plugin or a theme, nor are they clear on how exactly I'd go about controlling where the component gets put on the page.
Beta Was this translation helpful? Give feedback.
All reactions