Official image host for GitHub projects?

前端 未结 6 1592
忘了有多久
忘了有多久 2020-12-28 12:23

Whenever I need to include a picture in a GitHub project\'s README file I usually just stick it in a Screenshots folder and relatively link to it. However this unnecessarily

相关标签:
6条回答
  • 2020-12-28 12:41

    Simply open the image you wish to post on GitHub, right-click, Copy Image, then in the Github post, hit ctrl-v.

    0 讨论(0)
  • 2020-12-28 12:50

    Fastly is not an image host, it's a content delivery network. See their website and this CDN Planet entry.

    If you peek at the source code of the README.md page in the MMDrawerController repository, you'll notice that the image aren't initially stored at Fastly.net.

    Moreover, they're supposed to be served through standard http (ie. not https).

    <p align="center" >
    <img src="http://mutualmobile.github.io/MMDrawerController/ExampleImages/example1.png" width="266" height="500"/>
    <img src="http://mutualmobile.github.io/MMDrawerController/ExampleImages/example2.png" width="266" height="500"/>
    </p>
    

    The links your refer to are dynamically rewritten thanks to the Camo tool.

    This tool simplify routing images through an SSL host in order to prevent users from being warned by their browser about potential unsecure content as every GitHub.com content is being served over https.

    0 讨论(0)
  • 2020-12-28 12:50

    I built MMDrawerController. I host the images in a gh-pages repo and link to them from the README.

    0 讨论(0)
  • 2020-12-28 12:56

    GitHub itself has a "secret" feature to upload images.

    I read about this in a comment by GitHub's own Phil Haack:

    I edit (or create) an issue and drag it into there and copy the resulting markdown into my post. It's probably an abuse of GitHub issues.

    If you do it like this, the image will be stored on some GitHub server, and it will have a URL like this one:
    https://f.cloud.github.com/assets/19977/1656110/a3f8b280-5b6d-11e3-818d-c06ab05bd613.jpg

    0 讨论(0)
  • 2020-12-28 13:00

    No you don't need a host. just put images in root of your own project and give link in readme.md something like this

    ![Preview1](./img1.PNG)
    ![Preview2](./img2.PNG)
    ## and so on
    
    0 讨论(0)
  • 2020-12-28 13:02

    Follow these steps to host the image on GitHub's official website.

    1. Visit any repository on GitHub and click your way through to the issues.

    2. Create a new issue by clicking the New Issue button. You'll now see the title and description fields.

    3. Drag and drop an image onto the description field. This will start the uploading process.

    4. Copy the URL and use it in README, issues, or pull requests however you like.

    Demonstration of how it works:

    how to put an image in readme using GitHub Offical hosting

    0 讨论(0)
提交回复
热议问题