【问题标题】:How can I reference a document outside of the Docusaurus docs directory?如何引用 Docusaurus docs 目录之外的文档?
【发布时间】:2021-07-21 19:52:09
【问题描述】:

我想将我所有的 Docusaurus 文档整理到 docs 目录下。但是,我也想引用现有的markdown文档,例如README.md等。如何从sidebar.js引用docs目录之外的文档?

【问题讨论】:

  • 你找到解决方案了吗?
  • 很遗憾没有

标签: relative-path docusaurus


【解决方案1】:

我的解决方案是将它们包含为 React 组件

例如如果您想从根目录中包含自述文件,请将这样的文件放在您的 docs 目录中:

---
title: Custom README title (for sidebar etc)
hide_title: true
---

import Readme, { toc as ReadmeTOC } from '@site/../READ';

<Readme />

export const toc = ReadmeTOC;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-12-04
    • 2016-10-17
    • 1970-01-01
    • 2014-02-19
    • 2023-02-20
    • 2021-11-06
    • 2017-09-28
    • 2013-01-12
    相关资源
    最近更新 更多