mirror of
https://github.com/kovetskiy/mark.git
synced 2025-04-23 21:32:41 +08:00
Use relative links for objects within the same Confluence instance
This commit is contained in:
parent
f7dda910c5
commit
e5398b4ee1
@ -203,10 +203,15 @@ func getConfluenceLink(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if page != nil {
|
if page != nil {
|
||||||
// Needs baseURL, as REST api response URL doesn't contain subpath ir
|
|
||||||
// confluence is server from that
|
|
||||||
link = api.BaseURL + page.Links.Full
|
link = api.BaseURL + page.Links.Full
|
||||||
}
|
}
|
||||||
|
|
||||||
return link, nil
|
linkUrl, err := url.Parse(link)
|
||||||
|
if err != nil {
|
||||||
|
return "", karma.Format(err, "parse URL: %s", link)
|
||||||
|
}
|
||||||
|
// Confluence supports relative links to reference other pages:
|
||||||
|
// https://confluence.atlassian.com/doc/links-776656293.html
|
||||||
|
linkPath := linkUrl.Path
|
||||||
|
return linkPath, nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user