Docusaurus 链接导航到其他页面,但不导航到特定锚点
在这样的文件夹结构中:
|- docs
|- folder
|- file_1.md
|- file_2.md
我有这样的链接:
In file_1.md: [File 2 Anchor](file_2.md#file-2-anchor)
In file_2.md: [File 1 Anchor](file_1.md#file-1-anchor)
.md 文件都没有 slug。
在 docusaurus.config 中:
url: 'https://web.<mysite>.ca ',
baseUrl: '/docs/training/dev/',
链接在 localhost 上运行(使用相同的 baseUrl),导航到正确的页面和锚点。已发布的链接导航到正确的页面,但不是锚点(对于任何锚点类型),并且始终跳转到目标页面的顶部
本地链接和已发布的链接解析相同,例如:
<baseURL>/docs/training/dev/docs/folder/file_1#file-1-anchor
链接始终在本地使用相对或绝对路径,但已发布链接的结果始终相同。似乎还有更多关于如何解决链接的问题。
感谢您的建议。
In a folder structure like this:
|- docs
|- folder
|- file_1.md
|- file_2.md
I have links like this:
In file_1.md: [File 2 Anchor](file_2.md#file-2-anchor)
In file_2.md: [File 1 Anchor](file_1.md#file-1-anchor)
Neither .md file has a slug.
In docusaurus.config:
url: 'https://web.<mysite>.ca ',
baseUrl: '/docs/training/dev/',
The links work on localhost (using the same baseUrl) navigating to the correct page and anchor. The published links navigate to the correct page but not the anchor -- for any anchor type -- and always jump to the top of the target page
Both the local and published links resolve the same, for example as:
<baseURL>/docs/training/dev/docs/folder/file_1#file-1-anchor
The links always work locally using relative or absolute paths but the result is always the same for the published links. Seems there is something more to how the links are being resolved.
Advice is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
链接不得包含文件的扩展名(
.md
、.mdx
),因此更改为
我在这里测试的EXAMPLE
,如下所示文件。要测试它,请将它们放在同一目录中(这并不重要)。
file1.md
file2.md
The links must not include the extension of the file (
.md
,.mdx
), so changeto
EXAMPLE
I tested here, with the following files. To test it, put them in the same directory (doesn't mater wich).
file1.md
file2.md