I'm working on a README.md file in a GitHub Enterprise repository.
It's funny, I'm using the same code snippet I use in my public repositories, i.e.
![alt text](https://raw.github.com/repository/project/master/filename.png)
Unfortunately, this kind of command doesn't work on the enterprise project.
I see one big difference in the raw version of a picture. Specifically, in the enterprise repository I have a the URL of the raw picture file with a query parameter, e.g.
?token=AAABGqiVI6Qk6Mi4ZM0ZBeHrXexkUBmNks5W_AyCwA%3D%3D
Does someone know how to embed a picture in a markdown in GutHub enterprise?
Have you tried working with using relative links to your images? So trying to do something like ![](img/image_name.png)
? The reason why I recommend this is because if they are working with your repo, they should have these images regardless and if they are accessing this online, GitHub will handle the rendering properly. This is assuming that you want this information to be facing towards others to be able to see it.
It is actually recommended by GitHub to not use absolute links such as [Absolute README link](https://github.com/username/repo/blob/branch/docs/more_words.md)
Source
Edit: I also found this question/answer on SO that might be useful to refer to about how to solve it. It also mentions with the relative linking:
GitHub recommend that you use relative links with the
?raw=true
parameter to ensure forked repos point correctly.
It also talks about how you can have a separate branch that can contain all of your screenshots and you can reference them as:
![Alt text](/../<branch name>/path/to/image.png?raw=true "Optional Title")
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With