Embedding images inside a GitHub wiki (gollum) repository?

前端 未结 15 746
时光取名叫无心
时光取名叫无心 2021-01-30 00:43

The Github wikis are backed by a separate git repository then the main project repository.

This post by the Github team makes it sound like you should be able to link to

15条回答
  •  梦毁少年i
    2021-01-30 01:31

    The following markdown will reference an image in your GitHub repo from within your corresponding GitHub wiki

    ![My Alt Text](../blob/master/Path/ToAsset/In/Repo.png?raw=true)
    

    The above example assumes that you have the following file structure in your repo

    • Path
      • ToAssets
        • In
          • Repo.png

    For a real world example, if I wanted to reference this image in github from the corresponding wiki, I'd use this markdown

    ![Azure App Settings](../blob/master/TrelloWorld/TrelloWorld.Server/Assets/Azure_AppSettings.png?raw=true)
    

    Caveats

    1. Case matters
    2. If you are on the special Home page of the wiki, you do not need to go up a level with the ../ In my example above, the correct link would be

    For Home Page:

    ![Azure App Settings](blob/master/TrelloWorld/TrelloWorld.Server/Assets/Azure_AppSettings.png?raw=true)
    

提交回复
热议问题