web: use version family subdomain for in-app doc links

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2022-12-22 17:03:08 +01:00
parent 4c133b957c
commit e4e7a112e3
11 changed files with 42 additions and 15 deletions

View File

@ -1,3 +1,4 @@
import { docLink } from "@goauthentik/common/global";
import "@goauthentik/elements/Alert";
import { AKElement } from "@goauthentik/elements/Base";
@ -56,7 +57,7 @@ export class Markdown extends AKElement {
if (md.filename === "index.md") {
relPath = relPath.replace("index.md", "");
}
const baseURL = "https://goauthentik.io";
const baseURL = docLink("");
const fullURL = `${baseURL}${relPath}.$1`;
return input.replace(relativeLink, `href="${fullURL}" target="_blank"`);
}