Replies: 18 comments 42 replies
This comment has been hidden.
This comment has been hidden.
-
Re-implement blog list page as card cascade viewThe blog list page by default displays posts as a list, with IMO very low page space usage efficiency. I customized it into a card cascade (I plan to implement lazy-loading in the future when the number of posts increases), and this makes me able to display much more information per unit space. Infos
ScreenshotsImplementationI swizzled |
Beta Was this translation helpful? Give feedback.
-
Improve and customize the blog sidebarThe blog sidebar only display a list of blog posts. We should be able to add more useful information here:
Infos
ScreenshotsImplementationRequires swizzling multiple components in https://github.com/temporalio/documentation/tree/master/src/theme => large API surface to maintain over time Also, swizzled components are modified to include hardcoded data, because Docusaurus does not provide the relevant data as sidebar props |
Beta Was this translation helpful? Give feedback.
-
Navbar should support "multi-tenant" sitesCustomizing the header is a big one for us. Our platform has multiple sub-libraries that users install, so for our documentation, we have a single docusaurus site for each because we struggled to use the versioning system for multiple libraries. We then run those sites on separate paths ("multi-tenant"). However, docusaurus's theme (understandably) expects to be single tenant. So, we needed to modify the navbar to let the user go back to the root site. You can see that here: https://ionic.io/docs where I was able to do this by modifying the |
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
-
Some reliable style customizationsFor our site, we need a few style customizations which I believe could be achieved just using custom CSS if reliable class names are available for customization. I think the difficulty right now is that the class names that could be customized aren't easily identifiable [related discussion]. If I understand correctly, that's being worked upon in #6116 which is nice to see! I'm sharing the customizations that we find necessary here hoping it would be useful:
Let me know in case you need more information regarding any of the above. ScreenshotsImplementationAchieved the customizations via hacky CSS that do the trick for the given Docusaurus version but break after a Docusaurus upgrade. The version we use now and the one in which the customizations work is one of the alphas and the version in which some customizations break is the latest beta. We haven't gotten around to upgrading to the latest beta for now as we're sort of waiting it out to see if the stable version comes out soon 🤞🏼 😉 . But we do plan on upgrading before releasing the site for use withing the org. I could share the custom CSS here in case that would be helpful. |
Beta Was this translation helpful? Give feedback.
-
Customisations to
|
Beta Was this translation helpful? Give feedback.
-
Add a doc item header componentWebsites might want to enhance the default header with extra widgets. Common needs might be:
InfosA) Published/Updated Date
B) Category Name
ScreenshotsABImplementationAThis requires a MDX component to be explicitly used on ever doc page. This is not ideal because someone could easily forget to add the MDX component to new doc pages, and ever doc page would need to be touched in the event the component's requirements change. BThis wraps a theme component that is no longer exposed. Since SuggestionIdeally, the solution would allow you to wrap a component that would allow someone to insert content before of after the main H1 on the doc item. |
Beta Was this translation helpful? Give feedback.
-
Different og:image (social sharing image) per pageI'd like to be able to provide a different og:image value, based on the URL of the page. Right now, I can only find a way to configure a site-wide og:image, by setting the image property of Infos
ImplementationAfter spending two hours digging through the source code of storybook and looking at the available options for swizzling, it seems that the best workaround would be to use a Cloudflare worker in front of the docs site. The worker will replace the value of the "og:image" property with a different value, based on the page's URL. Ideally, I'd like to have a way to do this from within Docusaurus: either by defining a template string, with a placeholder for the URL of the current page, or by providing a function that gets the URL of the current page and returns the respective og:image. |
Beta Was this translation helpful? Give feedback.
-
Split up DocItem componentWe would like to separate the sidebar and navbar/content into separate sections on the page. Currently the navbar stretches all the way across. It is fairly easy to remove from the layout component, but in order to add it above the page content there are a few hurdles to jump through. If the I think this would also benefit other sites since it would allow better customization of the version banner, breadcrumbs, version badge, pagination, footer, and table of contents. |
Beta Was this translation helpful? Give feedback.
-
Expose metadata outside of DocItemFor our specific use case, we need access to the How we're doing it in DocItem component I believe this would also benefit others trying to customize a Docusaurus site because there are plenty more metadata props besides |
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
-
Navigate through multiple (versioned) flavors of a productWe have one product that is available in Java and JavaScript. We have some common documentation for both languages as well as major parts that are relevant for only one of the languages. Infos
ScreenshotsNavbar for JS: Navbar for Java (versioning soon to come): Navbar for common pages: Note, that the three navbar items "Overview", "Java" and "JavaScript" are always shown. ImplementationAll our changes were possible with merely wrapping.
|
Beta Was this translation helpful? Give feedback.
-
Resizable split panes in docsThe goal is to load a code editor in a column on the right (iframe in this case) and allow the user to try out snippets in that editor. Currently done by using the Infos
ScreenshotsImplementationUsing Root element, used React-split-pane to split the entire page on demand. |
Beta Was this translation helpful? Give feedback.
-
Custom button in rendered snippetsWe would like to add more buttons next to word wrap, copy. For example a button that launches a codesandbox workspace. InfosNo implementation ImplementationOne would have to eject |
Beta Was this translation helpful? Give feedback.
-
Wider table of contents on non-doc pagesCurrently the layout of the non-doc pages is hardcoded with I’ve changed this with |
Beta Was this translation helpful? Give feedback.
-
How to custom Home IconIs is possible to change this home icon ? Thanks |
Beta Was this translation helpful? Give feedback.
-
Custom anchor link requirementsWorking with Docusaurus v3.5.2, I was having problems creating an anchor link that would scroll to the correct location in the document. The following link to
All anchors generated by Docusaurus have a
Without this |
Beta Was this translation helpful? Give feedback.
-
Hello everyone,
For the v2.0 launch of Docusaurus, one major goal is to make it easier to customize your site (see the blog post).
For that reason, I'd like to gather an exhaustive list of all the customization use-cases you have.
Goals
We want to ensure such customizations can be added in a robust way:
docusaurus swizzle
swizzle --wrap
command ([2.0] RFC: docusaurus swizzle --wrap/copy #5380)Instructions
Please describe the desired outcome of this customization (avoid the XY problem):
Please include all the info you can:
Here's an example template you can use:
I'll start a few example threads.
Thanks, everyone!
Beta Was this translation helpful? Give feedback.
All reactions