Questions tagged [docusaurus]

Docusaurus is a modern static site generator focused on documentation. It helps you to focus on your content and build optimized websites quickly.

Docusaurus is a performant static site generator by Facebook and can be used to create common content-driven websites (e.g. Documentation, Blogs, Product Landing and Marketing Pages, etc) extremely quickly. Its features:

  • Write using Markdown - Save time and focus on your project's documentation. Simply write docs and blog posts with Markdown and Docusaurus will publish a set of static html files ready to serve.
  • Built using React - Extend or customize your project's layout by reusing React. Docusaurus can be extended while reusing the same header and footer.
  • Translations - Localization comes pre-configured. Use Crowdin to translate your docs into over 70 languages.
  • Versioning - Support users on all versions of your project. Document versioning helps you keep documentation in sync with project releases.
  • Search - Make it easy for your community to find what they need in your documentation. We proudly support Algolia documentation search.

Useful Links

477 questions
3
votes
1 answer

How to call a JS function at the page load of Docusaurus site?

I need to load a custom JS function I wrote at the beginning of the page load in a Docusaurus documentation site. What have I tried so far? Attempt #1: Appending the script to the index.js file (.\src\components\HomepageFeatures\index.js) This…
Ken
  • 243
  • 1
  • 13
3
votes
0 answers

Docusaurus server-side rendering could not render static page with path

I have a problem with displaying multiple API using Redocusaurus plugin My nav dropdown looks like in the image My Redocusaurus settings looks like in the image above I keep my yml files in the folder apiConfigFiles And locally everything working…
3
votes
1 answer

How to detect current language and use JS to present dynamic content in Docusaurus pages

I am using Docusaurus to build a site with two language - en and zh. What I want is a dynamic if-else in JS: if current_language is en: title = "en title" else: title = "zh title" How can I achieve this in Docusaurus pages? The default i18n…
Yang_____
  • 117
  • 8
3
votes
0 answers

themeConfig.docs.sidebar options throws 'ValidationError: "docs.sidebar" is not allowed' on build

I'm using Docusaurus 2.0.0-rc.1 and trying to add hideable: true and autoCollapseCategories: true options in docusaurus.config.js according to https://docusaurus.io/docs/sidebar#hideable-sidebar, but I've received an error during build: > docusaurus…
sincord
  • 31
  • 2
3
votes
1 answer

How to omit "index" entry from an autogenerated Docusaurus V2 sidebar

At work we have a basic Docusaurus v2 page for user documentation, and I can't share it for privacy reasons. Suffice it to say it has a sidebar which is autogenerated, where the top level contains a number of folders as categories and each category…
William
  • 296
  • 4
  • 14
3
votes
1 answer

Katex rendering equations multiple times

I am using Docusaurus to generate a static website. I integrated katex using the official instructions (https://docusaurus.io/docs/next/markdown-features/math-equations). I want to render this: $$ \begin{aligned} \begin{split} u &=…
Leon Bohmann
  • 402
  • 1
  • 4
  • 16
3
votes
0 answers

Any way to create page preview on hover?

In our docusaurus knowledge base we are building we are wanting to do some Wikipedia-style page preview effects on hover. I've seen a few ways to do it, but not any that would work in Docusaurus. Is there any way to do this well?
3
votes
1 answer

'docusaurus-start' is not recognized as an internal or external command

When I type in yarn start in myproject.github.io/websites I get this error: yarn run v1.22.11 warning package.json: No license field $ docusaurus-start 'docusaurus-start' is not recognized as an internal or external command, operable program or…
neubert
  • 15,947
  • 24
  • 120
  • 212
3
votes
2 answers

Adding external javascript to document page in Docusaurus v2

I'm building a component library of just HTML snippet and corresponding js/css and I'm using Docusaurus to document those compoents. I have a document page for each component. On the document page there is an example of each component. I'd like to…
evans863
  • 63
  • 4
3
votes
0 answers

Docusaurus V2 not automatically use swizzled component

I've create basic documentation website with Docusaurus V2 and I want to change layout of my site. So I run npm run swizzle @docusaurus/theme-classic layout -- --danger which copy layout js and css file to the directory. However, I need to change…
3
votes
1 answer

Docusaurus v2 - Search bar does not show up in Navbar

Default Search bar does not show up in the header nav on a new site built using Docusaurus V2 but /search shows the search page: Steps I followed: Created a new site using command npx @docusaurus/init@latest init mysite classic. Per…
Suren Konathala
  • 3,497
  • 5
  • 43
  • 73
3
votes
3 answers

How to include (import) markdown file content in Docusaurus V2?

Is there any way to include markdown file content into another markdown file in Docusaurus V2? I'm trying to organize my docs folder structure. When we create a markdown file, e.g. in docs, Docusaurus automatically sets up the file path in some…
Jeff Pal
  • 1,519
  • 1
  • 17
  • 28
3
votes
2 answers

Link to static JSON file

In Docusaurus V2 how to link to a JSON file in the static folder? I tried the following in a markdown file: An exemple, is the following [JSON dataset](../../static/data/solar-radiation.json). But Docusaurus then produce the following…
Lucas S.
  • 312
  • 3
  • 15
3
votes
1 answer

How to change width of a sidebar in docusaurus

I want to change the sidebar width in docusaurus, I am only allowed to change the width of sidebar in a particular page.Can anyone suggest me a solution
Selbin C R
  • 31
  • 2
3
votes
2 answers

Displaying the sidebar on the landing page in ‘docs-only’ mode

I’m setting up documentation in Docusaurus V2, and have set it up to be ‘docs-only’ by following the instructions in the Docusaurus documentation (setting the routeBasePath and homePageId). That works as expected. The problem is that when you land…
Cadi
  • 31
  • 1