I have a secret Github gist with a markdown document. I've created three simple .png
images that need to be embedded in the document as it displays at the gist URL.
I cloned my gist repo, added the image files, and pushed to master. Now, at the gist URL, I see the image files in addition to the markdown file.
However, whenever I add the following simple code to try to display the image, it does not work (it merely hyperlinks the text "Image" and if clicked, takes me to a page that says "not found" even though I can verify it is exactly the URL address that links to the image file):
![Image:](https://gist.github.com/my_username/3998173298588e8dc9d3#file-file_name-png)
However, in my local copy of the markdown document, if I make the image links refer to relative file paths (such as ![Image:](file_name.png)
) then it works just as expected if I view the document in a markdown viewer such as Mou on my local machine. It still does not work at the gist URL, regardless of local vs. github-based URLs.
From everything I've read, this appears to be the correct way to add an image to a gist (clone the gist repo, add files, push to master, then link them from their resultant Github URLs).
It's not working ... what step am I missing?
See this answer for more information, but the short answer is that it just doesn't work in gists :/.
If you look at the source for this gist post, all of the embedded images are actually hosted on imgur, even though the images are also attached to the gist.