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.

Filter by
Sorted by
Tagged with
18 votes
7 answers
7k views

Is there a way to have two docs in Docusaurus 2?

As I know, Docusaurus supports customized pages, but is there a way to have two docs in one Docusaurus project? The original Navbar items have: Docs Blog ... I want to have something like this: ...
  • 440
18 votes
3 answers
20k views

Vertical bar symbol within a markdown table

Markdown tables use vertical bars as field separators, but I need to write a vertical bar within some cells. Is this possible? I'm using GFM (GitHub Flavored Markdown). Can I escape the vertical bar ...
  • 50.1k
18 votes
4 answers
6k views

How can I add custom scripts in index.html's head part in Docusaurus V2?

We are making a website with Docusaurus V2. In Docusaurus V1, there is a scripts setting in siteConfig.js to cusutimize html's head content. But, I cannot find the corresponding setting in Docusaurus ...
  • 6,996
12 votes
6 answers
3k views

Is it possible to detect if docusaurus is in light or dark mode?

I have an image with a white background, which looks off on docusaurus dark theme, so I want to detect when the user changes theme so I use a different image.
12 votes
2 answers
6k views

Change image size in Docusaurus

I'm using Docusaurus to make documentation. I want to add an image to a markdown file, and also resize it to prevent it to be larger than needed. Checking This answer, I realized this is possible ...
  • 15.4k
10 votes
2 answers
2k views

Docusaurus - How to remove TOC(table of contents)?

I'm using docusaurus for our dev docs. How to disable TOC? Thanks.
  • 555
10 votes
2 answers
2k views

Markdown content in tabs using Docusaurus v2

I try to add markdown code inside a Tab, as explain the documentation. The name file name has .mdx extension. Here its content: import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; &...
  • 3,505
10 votes
3 answers
2k views

Is it possible to support visitor comments in Docusaurus?

I'm building a website using Docusaurus 2. My website will contain docs and blogs. I wonder if it is possible to let visitors comment below an article? I guess, if we support comments, we need an ...
  • 6,996
9 votes
2 answers
5k views

Docusaurus 2 inclusion of a video file in a markdown file

Using Docusaurus for help documentation. I can include images, gifs, and reference a youtube video (use iframe). But it is not clear to me how to include a video in a markdown file. I am expecting the ...
9 votes
3 answers
2k views

Possible to publish docusaurus cross-repo from multiple-repositories, to aggregate docs together?

My question: Are there any docusaurus features out of the box (beyond https://github.com/facebook/docusaurus/pull/764) that will make the following easier? (I've asked this here because their github ...
  • 4,085
8 votes
5 answers
4k views

How to pass env var to Docusaurus v2

I've been trying to get environment variables to work in my documentation build. I've had some success with adding a dotenv-webpack plugin and substituting values that way. This has the downside of ...
  • 1,373
8 votes
3 answers
4k views

Docusaurus v2 collapsible section in markdown

Is there an easy way to create a collapsible section in Docusaurus V2 markdown? Would look for something similar to this on GitHub: https://gist.github.com/joyrexus/16041f2426450e73f5df9391f7f7ae5f
  • 301
7 votes
1 answer
1k views

How can we link a Docusaurus website to a database?

I'm building a website with Docusaurus V2. Since a Docusaurus website is fundamentally a React app, I wonder how we could add an authentication system to the website. Is there any guide or sample ...
  • 6,996
7 votes
1 answer
162 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
6 votes
3 answers
4k views

Redirect to docs from landing page in docusaurus v2

Since I don't have a landing page, I would like to redirect to the main doc page docs/main I tried to follow the instructions: https://docusaurus.io/docs/en/site-creation#docs-landing-page from v1, ...
  • 71
5 votes
3 answers
2k views

Does Docusaurus support renaming the 'docs' output folder?

I am currently evaluating using Docusaurus to generate a static web site. The site itself is not documentation focused, in fact, the site is not even computer or technology related. But as a techie ...
5 votes
1 answer
3k views

Docusaurus - how to open external links in new tab?

I am using Docusaurus and would like to open external links in new tabs. I would prefer to use code for this rather than the solution of writing html code in my markdown document as per this answer. ...
  • 135
5 votes
1 answer
178 views

Github codespaces project live preview not working

I am running a simple project of Docusaurus with npm start which runs successfully. Using Github Codespaces to run the project but the forwarded route doesn't seem to be working. Attached the ...
  • 488
5 votes
2 answers
1k views

How to add a Docusaurus website within Next.js Website as a route

Does anyone have any pointers on how to go about adding a /docs page for website documentation to a next.js app? I've looked up Docusaurus but it seems like it's already a react app itself. Is there a ...
  • 1,166
5 votes
0 answers
305 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
1k 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
3 answers
1k views

How to add icon in the headerLinks in Docusaurus project

To add headerLinks, code is headerLinks: [ { doc: "introduction", label: "Docs" }, { doc: "faq", label: "FAQ" }, { href: "https://github....
4 votes
1 answer
3k views

importing a javascript module in a docusaurus page

On one of the doc/*.md pages in my documentation website I'd like to be able to have a javascript tree view thing. https://github.com/storybookjs/react-treebeard seems like it'd work well but it's not ...
  • 15.6k
4 votes
2 answers
4k views

Custom Search Bar in Docusaurus 2

I'm just experimenting with Docusaurus V2, i want o enable offline search witth LUNR(https://lunrjs.com/) Search, like described, in this blog. https://v2.docusaurus.io/feedback/p/offline-search i ...
  • 322
4 votes
2 answers
731 views

On Docusaurus, how do I disable the external link SVG?

I'm trying to implement Sign in and Sign up buttons on the Docusaurus navbar... ...but since my app is in a subdomain, Docusaurus thinks they are external links and adds this ugly SVG. How do I ...
  • 55.6k
4 votes
1 answer
917 views

Unable to start Docusaurus 2 website because of unknown markdown errors

When starting yarn for my docusaurus 2 website, I see that the website is running on a local host (http://localhost:3000/). However, I noticed that there was an Unterminated JSX contents error. ...
  • 41
4 votes
1 answer
1k views

docusaurus 2: run custom script for every page

Is it possible to run some custom script for every page? E.g., I want to run alert(1); on every page. How can I do that without the sizzling of any components? I know it can be done by creating jsx ...
4 votes
1 answer
3k views

Docs link broken for Docusaurus v2 project

I am building a documentation site using docusaurus (version 2). It gives a 404 on /docs PAGE NOT FOUND error. Links: My Github Project Netlify hosted site I am new to docusaurus, and I might have ...
  • 1,326
4 votes
1 answer
1k views

Change default text color in Docusaurus v2

In Docusaurus v2 I can override the default text color for each class as: .features { display: flex; align-items: center; padding: 2rem 0; width: 100%; color: red; } I don't like this ...
4 votes
1 answer
374 views

Generating static Docusaurus site for use without without webserver

I have recently started experimenting with Docusaurus and have managed to add pages, menu items etc. I can run the site locally using the following npm run start I have also attempted to build the ...
  • 4,751
4 votes
2 answers
3k views

Center a hyperlink or an image in Docusaurus

I'm building a website with Docusaurus V2. I have a file link: [10Studio-Sample-EN.xlsx](https://www.10studio.tech/files/10Studio-Sample-EN.xlsx) Now, I want to put that link in the center (...
  • 6,996
4 votes
2 answers
1k views

Docusaurus 2 How to add custom react component in navbar

From the docusaurus docs, the navbar items can only have certain types like link, dropdown and search. How do I add custom buttons like if I want to add login button ?
4 votes
1 answer
324 views

How to change the docusaurus browser tab text to match the current page

On a Docusaurus Site, it seems that any page will simply display the site title in the browser tab, but once you get down to the doc level, the browser tab does reflect the title of the page (doc) you ...
  • 51
4 votes
0 answers
795 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
3 answers
848 views

Docusaurus v2 and GraphQL Playground integration

I'd like to render GraphQL Playground as a React component in one of my pages but it fails due to missing file-loader in webpack. Is there a way to fix this in docs or do I need to create new plugin ...
4 votes
1 answer
409 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
3 answers
5k views

Custom Login page in Docusaurus

I have a task at work, It is to implement the login page inside the Docusaurus. I am trying to customizing the index.js by adding some HelloWorld. Including login.js which has actual Docusaurus Index ...
  • 489
3 votes
1 answer
1k views

Is there a way to use Docusaurus just for the /docs directory?

I have an existing website, and just want to use docusaurus to manage the /docs directory (e.g. published as a static site into there). When I follow all the documentation it creates both the docs ...
  • 137
3 votes
1 answer
4k views

'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 ...
  • 15.6k
3 votes
1 answer
476 views

How to change the breakpoint for slidingNav in Docusaurus

I have just two header links in my Docusaurus site: Docs & GitHub. I would like to have these links remain in the header until I shrink the browser down to 500px. Unfortunately, the links slide ...
  • 23.2k
3 votes
1 answer
1k views

How to load external (remote) Markdown files into Docusaurus?

Seems like a very basic question, but I could not find an answer in SO, docs or GH issues: We are transferring an existing doc site to Docusaurus V2. Many of our .md files are stored across different ...
3 votes
2 answers
666 views

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 ...
  • 31
3 votes
1 answer
57 views

Custom Tag Page in Docusaurus

I want to create a custom Tag Page for docusaurus. I am using the classic theme and successfully swizzled DocTagDocListPage. So now I can change the template for all tag pages. What I want to do is ...
  • 3,035
3 votes
1 answer
41 views

Self-hosted deployment of docusaurus on 2 URLs

I am using Docusaurus to provide a User Manual for a web app that is hosted on an AWS EC2 virtual server. The user accesses it through a button on the app. I am trying to set it up so that it will ...
  • 525
3 votes
1 answer
116 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
986 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
737 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
255 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 ...

1
2 3 4 5
9