将图像添加到GitHub上的README.md [英] Add images to README.md on GitHub

查看:132
本文介绍了将图像添加到GitHub上的README.md的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我加入了 GitHub 。我在那里托管了一些项目。

Recently I joined GitHub. I hosted some projects there.

我需要在自述文件中包含一些图像。我不知道该怎么做。

I need to include some images in my README File. I don't know how to do that.

我搜索了这个,但我得到的只是一些链接,告诉我在网络上托管图像并指定图像README.md文件中的路径。

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".

有没有办法在没有托管任何第三方虚拟主机服务的图像的情况下执行此操作?

Is there any way to do this without hosting the images on any third-party web hosting services?

推荐答案

试试这个降价: $ b

Try this markdown:

![alt text](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.

![alt text](https://raw.githubusercontent.com/username/projectname/branch/path/to/img.png)

编辑:建议使用gh页面。此外,相对链接可能比我在上面发布的绝对URL更好。

just noticed comment linking to article which suggests using gh-pages. Also, relative links can be a better idea than the absolute URLs I posted above.

这篇关于将图像添加到GitHub上的README.md的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆