Cli*_*lif 6 markdown github relative-path readme
在 PULL_REQUEST_TEMPLATE.md 中按照指示使用相对链接(https://help.github.com/articles/about-readmes/#relative-links-and-image-paths-in-readme-files)不会相对正确地链接.
在实际 PR 中查看时:
[CONTRIBUTING.md](/.github/CONTRIBUTING.md)?路线:https://github.com/.github/CONTRIBUTING.md。
[CONTRIBUTING.md](.github/CONTRIBUTING.md) [CONTRIBUTING.md](./.github/CONTRIBUTING.md)路线:
https://github.com/owner/repo/compare/.github/CONTRIBUTING.md
而不是https://github.com/owner/repo/.github/CONTRIBUTING.md.
更改为../上一级对 PR 有效,但在 GitHub UI 中查看时会断开链接。
单击在 GitHub 上查看的链接有效:https://github.com/fs-webdev/fs-dialog/blob/master/.github/PULL_REQUEST_TEMPLATE.md,只是不在 PR 内。
(我觉得这曾经在 2017 年有效)
在两种情况下按预期具有相对链接功能的正确方法是什么?
不幸的是,给定的实现似乎只考虑当前 URL,而不是存储库中的实际文件路径。
创建问题时可以注意到相同的限制(通过例如
https://github.com/owner/repo/issues/new:):
[CONTRIBUTING.md](.github/CONTRIBUTING.md)
->
https://github.com/owner/repo/issues/.github/CONTRIBUTING.md
我只能通过指定完整的URL 路径(包括前导/)来使相对链接正常工作:
[CONTRIBUTING.md](/owner/repo/.github/CONTRIBUTING.md)
->
https://github.com/owner/repo/.github/CONTRIBUTING.md
话虽如此,抽象只能到达URL 主机(即:)
https://github.com。
| 归档时间: |
|
| 查看次数: |
512 次 |
| 最近记录: |