Search code examples
githubwiki

How can I show a image on the main Github Wiki page


I am trying to find out why I can't show an image on my home.md page. Images on other pages are working.

Home.md

![GOO Components Mindmap](images/GOOComponents.png) Not working

Genstart-Solr.md

![Fanen SolrLoadBalancer](images/SolrLoadBalancer.png) Working

All *.md files are in the root, images in the images folder. I have tried to put the working images on the home page, but without any success.


Solution

  • This problem is caused by the fact that Github is different resolves relative links from home wiki page and other pages. More precisely the difference in the address of the main page and the rest.

    You can see it if you open your wiki pages. I'll have:

    https://github.com/User/Repo/wiki - for home page, and

    https://github.com/User/Repo/wiki/somePage for others

    SO you just need to use such src url in your home page:

    ![GOO Components Mindmap](wiki/images/GOOComponents.png)