我可以基于构建时间的变量集中在MDX文件中包含 /排除内容吗?
我很喜欢使用Docusaurus,这对我来说是一个不错的变化。我正在使用Docusaurus v2.18。我希望能够从一组源文件中构建两套不同的文档。根据部署代码的环境,某些内容会有一些差异,我想将这些差异放在IF/Endif块中。我认为这是一个简单的用例,
ifeval::["{buildTarget}"=="environmentA"]
```
code block A content here
```
endif::[]
几乎
ifeval::["{buildTarget}"=="environmentB"]
```
code block B content here
```
endif::[]
所有内容都是标准的标记,但是我很高兴使用MDX / JSX包含 /排除内容。感谢您的帮助!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论