merge: stack assistant on mobile boards
This commit is contained in:
1326 files changed
+131355
-46380
No files matched your search
@@ -1,6 +1,15 @@
|
||||
import type { HomarrDocumentationPath } from "./homarr-docs-sitemap";
|
||||
|
||||
const documentationBaseUrl = "https://homarr.dev";
|
||||
const defaultDocumentationBaseUrl = "https://homarr.dev";
|
||||
|
||||
const getDocumentationBaseUrl = () => {
|
||||
const browserValue =
|
||||
typeof document === "undefined"
|
||||
? undefined
|
||||
: document.querySelector<HTMLMetaElement>('meta[name="homarr-website-url"]')?.content;
|
||||
const serverValue = typeof process === "undefined" ? undefined : process.env.HOMARR_WEBSITE_URL;
|
||||
return (browserValue || serverValue || defaultDocumentationBaseUrl).replace(/\/+$/u, "");
|
||||
};
|
||||
|
||||
// Please use the method so the path can be checked!
|
||||
export const createDocumentationLink = (
|
||||
@@ -8,7 +17,7 @@ export const createDocumentationLink = (
|
||||
hashTag?: `#${string}`,
|
||||
queryParams?: Record<string, string>,
|
||||
) => {
|
||||
const url = `${documentationBaseUrl}${path}`;
|
||||
const url = `${getDocumentationBaseUrl()}${path}`;
|
||||
const params = queryParams ? `?${new URLSearchParams(queryParams)}` : "";
|
||||
return `${url}${params}${hashTag ?? ""}`;
|
||||
};
|
||||
Reference in new issue
Block a user