Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How can I link to another page in a BitBucket wiki in Markdown syntax?

Florian Haag January 21, 2019

I am trying to integrate various Markdown files that I have prepared offline into my BitBucket wiki. I have successfully committed the files via Git and I can open them within the BitBucket website, but somehow, I fail to link to them. I know it should be obvious, but I haven't yet found out how to do it, and the documentation doesn't appear to describe inter-page linking.

For instance, within the wiki root directory, I have a subdirectory `a` with a file `b.md`.

I can open `https://bitbucket.org/<group>/<project>/wiki/a/b` and successfully arrive at the content of the aforementioned `b.md`.

However, if I add a link like `[b](a/b)` to one of my existing wiki pages, that link will not work (when trying from within the page preview). The resulting page will claim:

> Hmm... can't find that one

2 answers

1 accepted

5 votes
Answer accepted
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 23, 2019

Hello Florian,

I went through and tested this to ensure linking to internal pages works as expected. Using the following will only attempt to find the page/file within the same directory and it will not reach out to the child directory (even though you referenced it)

[Name](path/page)

If you’re wanting to reference a page that is a child under another page, you will need to use the full URL within the link, such as:

[Name](https://bitbucket.org/group/myproject/wiki/Home/ChildPage)

There was a bug reported for this similar issue, but the response back was this is how it is supposed to function and the bug request was closed. You may find that request at Issue #9014.

The solution for this seems to be to link the full URL to pages that are a child of another page.

I hope this information proves helpful in resolving your linkage issues within Bitbuckets wiki.

Regards,
Stephen Sifers

Florian Haag February 3, 2019

I do not consider linking to the full URL a valid solution - as soon as the base URL of the wiki changes (project rename, clone/branch, or already when displaying the wiki pages locally from the working copy), the links will be broken (because they point back to the original wiki location rather than the place where the entry page is currently displayed from). So, in short, Bitbucket's wiki doesn't support subfolders.

That is quite unfortunate in terms of structuring large wikis, as a checked out local working copy of a wiki Git repository will end up a huge folder with countless files.

Good to know of course, so I'll accept this answer.

Like # people like this
Holger Schmitz June 12, 2019

I know this is not perfect, but you can use relative URLs. 

[Name](Home/ChildPage)

 In this way, you can change the base URL of the wiki without breaking the links.

tempelorg October 19, 2020

I cannot make this work for a page that contains a "&" in its title, though.

1 vote
Roberto-R January 11, 2021

Child pages

Linking to child pages can be done directly:

Inside https://bitbucket.org/workspace/repo/wiki/Home:

# Home

See [Folder/File2]
(folder/file2)

Will correctly link to: https://bitbucket.org/workspace/repo/wiki/folder/file2

 

Peer pages

The accepted answer is still valid: there is no real support for linking to pages that have a different parent.

However, playing with relative URLs does seem to work (at least sometimes):

Inside https://bitbucket.org/workspace/repo/wiki/folder/file1:

# File 1

See [OtherFolder/File2](../../wiki/other_folder/file2).

 Will correctly link to: https://bitbucket.org/workspace/repo/wiki/other_folder/file2

 

If you only use a single parent directory symbol (../), the resulting URL will be /src/other_folder/file2. (This is how you can link to files from e.g. your README.md.)

 

Warning: use such linking at your own risk. This feels more like something that accidentally works than a real feature.

Tip: the preview feature on a wiki editing page seems to resolve link URLs the same way as the real wiki renderer, use that to test your links.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events