Embedding images inside a GitHub wiki (gollum) repository?

前端 未结 15 955
时光取名叫无心
时光取名叫无心 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条回答
  •  半阙折子戏
    2021-01-30 01:27

    I put both images and PDFs in my wikis. I clone the wiki and add an images and a files directory, then use the following markdown to embed image links and add file links:

    Images:

    [[/images/path/to/image.ext|ALT TEXT]]
    

    The leading slash isn't necessary if your wiki pages are all at the root level, but I use subdirectories and an absolute path resolves correctly and keeps things simple.

    Files:

    [link text](files/path/to/file.ext "ALT TEXT")
    

    Note, no leading slash for the wiki files path to resolve correctly as a link in this format.

    I documented this with more detail in a GitHub gist

提交回复
热议问题