gitlab

In GitLab: add link to a wiki page from an issue, a task, or a repo file


I'm trying to add links to a GitLab wiki page (from an issue, from a task or from repo files or from another wiki page).

I've tried absolute paths and different numbers of "../" in relative paths

What is the best way to do it? How many "../" are needed?


Solution

  • In GitLab the Wiki is at following URL:

    The URLs of Issues, Tasks, and Repository are:

    To prevent problems if the project's name or the domain's name change, I'd suggest to use relative paths.

    Depending on the place where you want the page to be linked from you'll need two or more parent directories (../).

    Here are examples on how to link to the wiki page page_to_link from different places on GitLab.

    https://gitlab.yourdomain.org/projectname
    └─── -
        ├─── issues
        │    └─── 123                       [Page to Link](../../wikis/page_to_link)
        ├─── tree
        │    └─── main
        │         ├─── filename.md          [Page to Link](../../wikis/page_to_link)
        │         └─── some_dir
        │              └─── filename.md     [Page to Link](../../../wikis/page_to_link)
        ├─── wikis
        │    ├─── another_page              [Page to Link](/page_to_link)
        │    │    └─── another_subpage      [Page to Link](/page_to_link)
        │    └─── page_to_link              <-- Target Page
        └─── work_item
             └─── 456                       [Page to Link](../../wikis/page_to_link)
    

    Please note that Links in GitLab wiki pages follow a Wiki-specific Markdown