文章首发及后续更新:https://mwhls.top/2638.html
新的更新内容请到mwhls.top查看。
无图/无目录/格式错误/更多相关请到上方的文章首发页面查看。
如有翻译问题欢迎评论指出,谢谢。
怎么给Github的README加图片
- Midhun MP asked:
- 最近我加入了Github,并且创建了一些项目。
- 但不清楚如何给我的README文件加图片。
- 我查过了不少文章,但都说我需要把图片放在网上,并且在README.md文件里指定路径。
- 有办法在不使用第三方服务的情况下加入图片吗?
- Answers:
- captainclam – vote: 2482
- 用这个markdown语法:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-6QaExh2B-1624105919376)(http://url/to/img.png)]
- 如果图片存在你的仓库里,可以直接使用链接指向原始版本的图片,像这样:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-3I2JQiN1-1624105919378)(https://github.com/[username]/[reponame]/blob/[branch]/image.jpg?raw=true)]
- resultsway – vote: 619
- 用相对路径:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-FXit5Sld-1624105919379)(relative/path/to/img.jpg?raw=true “Title”)]
- 或者试下
.fileExtention
: [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ri207Zq8-1624105919385)(./directory_1/directory_2/…/directory_n/plot.png)]
- Ahmad Ajmi – vote: 316
- 创建一个新的Issue。
- 上传图片到里面
- 复制链接到README文件里。
- 这里的YouTube视频详细解释了过程:
- https://www.youtube.com/watch?v=nvPOUdz5PL4
- captainclam – vote: 2482
How to add images to README.md on GitHub?
- Midhun MP asked:
- Recently I joined GitHub. I hosted some projects there.
- 最近我加入了Github,并且创建了一些项目。
- I need to include some images in my README File. I don’t know how to do that.
- 但不清楚如何给我的README文件加图片。
- I searched about this, but all I got was some links which tell me to “host images on web and specify the image path in README.md file”.
- 我查过了不少文章,但都说我需要把图片放在网上,并且在README.md文件里指定路径。
- Is there any way to do this without hosting the images on any third-party web hosting services?
- 有办法在不使用第三方服务的情况下加入图片吗?
- Recently I joined GitHub. I hosted some projects there.
- Answers:
- captainclam – vote: 2482
- Try this markdown:
- 用这个markdown语法:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-LQCRmZ6N-1624105919388)(http://url/to/img.png)]
- I think you can link directly to the raw version of an image if it’s stored in your repository. i.e.
- 如果图片存在你的仓库里,可以直接使用链接指向原始版本的图片,像这样:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Mw5rNip3-1624105919390)(https://github.com/[username]/[reponame]/blob/[branch]/image.jpg?raw=true)]
- Try this markdown:
- resultsway – vote: 619
- You can also use relative paths like
- 用相对路径:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-VWP5r4sy-1624105919392)(relative/path/to/img.jpg?raw=true “Title”)]
- Also try the following with the desired
.fileExtention
:- 或者试下
.fileExtention
:
- 或者试下
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-64qaP2Ii-1624105919393)(./directory_1/directory_2/…/directory_n/plot.png)]
- You can also use relative paths like
- Ahmad Ajmi – vote: 316
- You can create a New Issue
- 创建一个新的Issue。
- upload(drag & drop) images to it
- 上传图片到里面
- Copy the images URL and paste it into your README.md file.
- 复制链接到README文件里。
- here is a detailed youTube video explained this in detail:
- 这里的YouTube视频详细解释了过程:
- https://www.youtube.com/watch?v=nvPOUdz5PL4
- You can create a New Issue
- captainclam – vote: 2482