Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
342 views
in Technique[技术] by (71.8m points)

git - 在GitHub上将图像添加到README.md(Add images to README.md on GitHub)

Recently I joined GitHub .

(最近我加入了GitHub 。)

I hosted some projects there.

(我在那里举办了一些项目。)

I need to include some images in my README File.

(我需要在README文件中包含一些图像。)

I don't know how to do that.

(我不知道该怎么做。)

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?

(如果没有在任何第三方网络托管服务上托管图像,有没有办法做到这一点?)

  ask by Midhun MP translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

(我认为如果图像存储在您的存储库中,您可以直接链接到图像的原始版本。)

ie

(即)

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

Edit: just noticed comment linking to article which suggests using gh-pages.

(编辑:只是注意到链接到文章的评论,建议使用gh页面。)

Also, relative links can be a better idea than the absolute URLs I posted above.

(此外,相对链接可能比我上面发布的绝对URL更好。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...