2

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 differences in some of the content depending on the environment where the code is being deployed, and I would like to put those differences in if/endif blocks. This is what I think a simple use case would look like:

ifeval::["{buildTarget}"=="environmentA"]
```
code block A content here
```
endif::[]

and

ifeval::["{buildTarget}"=="environmentB"]
```
code block B content here
```
endif::[]

almost all of my content is standard Markdown, but I am happy to use mdx/jsx to include / exclude content. Thanks for your help!

DanR
  • 66
  • 5
  • It looks like there is a way to exclude entire dirs/files, but can't find anything yet on within files: https://stackoverflow.com/questions/56003652/is-there-a-way-to-exclude-paths-within-docs-directory-in-docusaurus – austin_ce Aug 25 '22 at 22:32
  • Thanks @austin_ce . I ended up using tabs and combining both sets of docs in one. This is working much nicer (in my opinion!). – DanR Aug 26 '22 at 23:35
  • Ah ok, so you just always include both environments in the build, separated by tabs in the code block? That sounds nicer indeed, though personally still looking for a way to exclude some pieces of pages for "work-in-progress" sections. – austin_ce Aug 29 '22 at 16:06

0 Answers0