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.

214 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7 votes
1 answer
163 views

Is it possible to disable JSX validation on docusaurus v2?

I have a website in docusaurus v1 that I am migrating to v2. It has several docs in .md format with embedded HTML tags. After the migration, the website won't load due to invalid tags. Is it possible ...
  • 1,273
5 votes
0 answers
307 views

Docusaurus: is writing to the filesystem during loadContent poor practice for plugins?

I'd like to populate my Docusaurus project with documentation using the "docs" plugin and a custom (JavaScript) plugin to connect it to a headless CMS. Currently, I'm using the loadContent ...
5 votes
2 answers
2k views

How do I embed global React components in Docusaurus v2?

I see that it is possible to embed React components with MDX: https://v2.docusaurus.io/docs/markdown-features/#embedding-react-components-with-mdx However, this method works for a specific page. How ...
4 votes
0 answers
803 views

How to reference files outside of Docusaurus root folder

My team and I are looking to implement a documentation system that allows engineers to put markdown files within a specified folder in each of their service root directories. Since we are in a ...
4 votes
1 answer
411 views

What's the best practice to fix history.pushState which is deleted by office.js?

Our team wants to build a documentation website that can be opened in browsers and Excel add-ins. We chose Docusaurus V2 as the main framework to build the documentation website, and embedded office....
3 votes
1 answer
118 views

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 ...
3 votes
0 answers
1k views

Docusaurus: how to display the link "Edit this page" on every doc page?

This will be a fairly easy question I assume but for the life of me, I can't figure out the answer. What I want: I want to display my Docusaurus documentation pages with a "Edit this page" ...
  • 31
3 votes
0 answers
127 views

Include specific lines of code from a source file in Docusaurus

I'm currently deciding whether to migrate my developer docs from Sphinx to Docusaurus. The one thing that's holding me back is that Docusaurus (and in fact Markdown in general) doesn't support pulling ...
  • 41
3 votes
1 answer
754 views

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 ...
  • 294
3 votes
0 answers
72 views

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 ...
3 votes
0 answers
256 views

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 ...
3 votes
1 answer
961 views

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/...
3 votes
1 answer
484 views

Minified React Error #321 with Docusaurus v2

I am trying to deploy Docusaurus v2 and I keep getting this error: Creating an optimized production build... √ Client Compiled successfully in 18.44s × Server Compiled with some errors in 20....
  • 31
3 votes
1 answer
401 views

How to support changes in older versions of docs maintained by docusaurus

I'm trying out Docusaurus tool for creating a documentation site. So far everything is okay until I came to Versioning. My understanding is that: Whatever is in your /docs/**/*.md is your latest ...
  • 555
2 votes
0 answers
231 views

How to tweak Docusaurus webpack config for some react component?

It seems that one of my component ( https://www.npmjs.com/package/@stoplight/json-schema-viewer ) needs some tweaks in webpack with Docusaurus Any ideas ? I tried to follow https://gist.github.com/...
  • 751
2 votes
0 answers
183 views

Cannot build docusaurus website from Docker

Hi all I have this Dockerfile: FROM node:16.14-alpine as build RUN npx create-docusaurus@latest project classic WORKDIR /project COPY ./docs/docusaurus/* docs RUN npm run build FROM nginx:1.17.4-...
  • 87
2 votes
1 answer
225 views

How to add AdSense's Ad Unit to the body of a web page built with Docusaurus

Is it possible to add AdSense's ad unit to the body of a Docusaurus web page? Whenever I paste the Display ad unit code into a markdown page of my site, the browser throws "Uncaught SyntaxError: ...
2 votes
1 answer
426 views

How to add cards in docusaurus site just like implemented in playground page in docusaurus site?

I want to add cards to my docusaurus v2 site just like in the Playground Page in docusaurus.io/docs/playground. Can someone tell me how to implement it?
2 votes
0 answers
176 views

Can I include / exclude content in mdx file based on a variable set at build time?

I am enjoying using Docusaurus, it is a nice change for me. I am using Docusaurus v2.18. I would like to be able to build two different sets of docs from one set of source files. There will be some ...
  • 41
2 votes
0 answers
411 views

Integrate C++ documentation into docusaurus

I have a large code base that I do want to document with docusaurus. I used doxygen for the project before but I like docusaurus more now. Is there a way to integrate the C++ functions/classes/methods ...
  • 123
2 votes
0 answers
215 views

DocuSaurus - Automatic JavaScript documentation

Is there a plugin or library that can be used to convert JavaScript code and comments into documentation in DocuSaurus? The only option I found was using jsdoc-to-markdown, and I would like to know if ...
  • 1,438
2 votes
0 answers
335 views

Docusaurus MDX - create links with a version variable

I'm using Docusaurus for building a documentation web-site for a project. The content is written as MDX files. Since the project has different versions I'd like to use links that contain the specific ...
  • 802
2 votes
1 answer
402 views

How to disable MDX in Docusaurus

I have an existing site that uses Markdown and has HTML snippets but do not want them to be treated as MDX. How can I disable MDX entirely for now?
2 votes
1 answer
903 views

Docusaurus v2 - Docs link in Nav Dropdown without versioning

I'm creating a Docusaurus v2 project that will host documentation for a number of tools. They're all related, so it makes sense for them to be hosted in one place - but they're distinct enough that ...
  • 1,123
2 votes
1 answer
283 views

Change the date format for the showLastUpdateTime at the bottom of pages

I've added the showLastUpdateTime: true, line to my docusaurus.config.js, and the date is showing at the bottom of documents, but the format is US (which doesn't work for the majority of ...
  • 3,230
2 votes
0 answers
405 views

Docusaurus2: Recommended way to import localized MDX in React?

Is there a known best way to support i18n for markdown imported into React? The documentation for the translation stuff indicates that it's in flux in Docusaurus 2; this case doesn't seem to be ...
2 votes
0 answers
659 views

Docusarus v2 - ¿How to add new tabs for Doc in NavBar?

I recently started using ** Docusaurus2 ** for tech notes in college. I am interested in creating one or more Docs2, Docs3. I have seen that it is a pluging that has to be duplicated. But with my ...
  • 491
2 votes
1 answer
245 views

Docusaurus V2 remove version label from doc pages

In each page of docs the label Version: Next is visible: Is there a way to disable and remove the label? Since I don't want to add multiple versions to my documents, I don't need the label.
  • 15.5k
2 votes
2 answers
2k views

Adding JS code snippets (full story, mixpanel, etc.) to Docusaurus.io

I'm trying to find out how can I add JS code snippets to work with Docusaurus.io (https://docusaurus.io). I want to add some analytics tools to my Docusaurus based web documentation such as - mixpanel,...
1 vote
0 answers
19 views

How to hide the dropdown in docusaurus navbar after clicking a particular option

I am trying to build a docusaurus site which has a dropdown linked to sidebar. Upon clicking a metallic dropdown I want to hide that dropdown. Is it possible to achieve this? My docusaurus.config.js ...
1 vote
0 answers
16 views

Math equations not rendering in docusaurus

Following instructions exactly as they are on: https://docusaurus.io/docs/markdown-features/math-equations Also checked that katex.css was properly loaded. But equations not rendering. Below are the ...
1 vote
0 answers
13 views

Plugin for site variables?

I'm working on transferring a site from Docsify to Docusaurus. We use variables across the site for URL's, API calls, versions, etc. On docsify we used a variable plugin called docsify-variables and I ...
1 vote
0 answers
151 views

404 error after adding `trailingSlash: false` in a docusaurus website

I have a website made by docusaurus 2.0.0-beta.18. I realize that, in production, when I click on items in the sidebar it first goes to https://example.com/docs/a-page. If I reload the page, the url ...
  • 6,844
1 vote
0 answers
27 views

Page generation with docusaurus

I wonder if it is possible to generate static pages from data(e.g. JSON) in docusaurus. Is there any open source project made with docusaurus that does same thing?
1 vote
0 answers
75 views

Docusaurus failed to build on Linux

Can be successfully built in Windows, but not in Linux. I'm using docusaurus 2.3.1 Environment in Windows: Windows 10 node v16.17.0 npm 9.3.0 yarn 1.22.19 Environment in Linux: Centos 7.9.2009 node ...
  • 11
1 vote
0 answers
11 views

Rendering issues with our Docusaurus wiki

Rendering issues with our Docusaurus wiki page, when I navigate from staring the right pane renders properly beside left navigation pane, however when I refresh the page after navigating, the right ...
  • 11
1 vote
0 answers
107 views

How to get a single shared sidebar for a multi-instance Docusaurus site that has versioned and unversioned folders?

I’m using Facebook’s open source tool Docusaurus to provide documentation for a software component I’m currently developing. So far everything has been working great, but now requirements are getting ...
  • 11
1 vote
0 answers
44 views

Deploy docusaurus site (generated build files) offline inside flutter webview

I just started develop a website using docusaurus and I want to run this website within flutter on mobile (android or ios) ,I thought of running the build files (index.html) through flutter webview, ...
1 vote
1 answer
107 views

useEffect hook to check if browser is opened in mobile so that logo is displayed accordingly

This code is of the component which displays website logo accordingly. But problem with this code is, I am getting "ReferenceError: window is not defined" Because in SSR, its unable to catch ...
1 vote
1 answer
39 views

Why are classes getting stripped from <ul> tags in Docusaurus?

When I use unordered lists in Docusaurus Markdown files, the classes are removed from the HTML in the final output. I enter an unordered list into a Markdown file as HTML, eg: <ul class="...
1 vote
0 answers
107 views

Can't integrate with Algolia DocSearch

I try to integrate with Algolia DocSearch and it doesn't work. I followed exactly the steps listed here: https://docusaurus.io/docs/search#using-algolia-docsearch but notwhing happend for more then a ...
1 vote
0 answers
93 views

docusaurus - dynamic sidebar content based on access level

I'm looking at docusaurus for implementing documentation site. We want to have different access level - If you're not logged in, you can only see limited pubic doc, if you logged in then you can see ...
  • 1,420
1 vote
0 answers
86 views

Docusaurus Localization (l10n)

I'm using Docusaurus v2 and I'm trying to segregrate a documentation by country, as some features are only available at some specific locations. I've tried to take avail of the i18n feature, but the ...
1 vote
0 answers
41 views

Docusaurus v2 | Not able to scroll to top on route change

I am facing a weird issue in Chrome only: If I scroll the page, then click on an item in DocSidebar, the page navigates to a new URL but does not scroll to the top, but on click of second time it does....
  • 1,166
1 vote
0 answers
350 views

Docusaurus baseUrl issues with Static Hosting Vercel and Netlify

we are trying to build our documentation website with docusaurus. We are closed to launch our product. But we are facing problems with the deployment. We are trying to host the website with vercel. ...
1 vote
0 answers
145 views

Open an external page as an iframe within a docusaurus site

I want to be able to provide a link on my docusaurus ToC pointing to an external page (in this case it's a particular method in an API docs portal), such that the page loads within an iframe on the ...
  • 41
1 vote
1 answer
253 views

Local docusaurus plugins in typescript

I want to write local docusaurus plugins using typescript. (it works fine using js) Is this possible? Like the docs here suggest to put them under ./src/plugins/name-of-plugin. Reading the docs there ...
  • 3,299
1 vote
1 answer
182 views

ESLint not recognising Docusaurus aliases when using Typescript?

I'm working on a Docusaurus project running TypeScript/ESLint. More specifically, I have the rule: { 'import/no-unresolved': 'error', } I have got the setup: "devDependencies": { &...
  • 101
1 vote
0 answers
382 views

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 ...
  • 11
1 vote
0 answers
191 views

Docusaurus v2 set security headers

In Docusaurus v2 I want to implement some security headers. But I couldn't find any documentation about security headers in Docusaurus. Here are some header I want to add, especially to prevent other ...
  • 11

1
2 3 4 5