github用相对路径显示图片,在Github README.md上使用相对路径进行链接

本文档介绍了如何在GitHub的README.md中创建相对路径链接到仓库内的代码示例。作者发现自2012年8月8日后,只需提供文件的相对路径,如[文件.pdf](Documentation/file.pdf),即可正确链接,无需再包含`blog/master`部分。这是一个关于GitHub Markdown链接技巧的快速指南。
摘要由CSDN通过智能技术生成

I am trying to create links in my README.md that link to example code using a relative path, as opposed to the absolute path I am using now. For example, in the markdown file, if I use this:

[someLabel](https://github.com/username/repoName/somePathTo/myExampleCode)

It works no problem. But I would like to link it up using something like this:

[someLabel](username/repoName/somePathTo/myExampleCode)

This does not link up, as it gives me the ol' 404 not found error. Is there a way to link my examples on Github to my README using a relative path?

解决方案

They seem to have changed this since Aug 8 '12, so now all I had to do to reference my pdf file inside the Documentation folder (which is in my project's root) is this:

[file.pdf](Documentation/file.pdf)

So, no need to add blog/master part anymore. Hope it helps new people browsing this question.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值