feat: add default search engines seeding / set homarr docs as global server search engine (#2663)
* feat: add default search engines seeding * feat: set Homarr Docs as the default search Set the default search engine in server settings during seeding * refactor: use typed methods to define settings * feat: add insertServerSettingByKeyAsync * feat: update seeding logic for server settings * fix: format file using prettier * fix: disable eslint for `urlTemplate` * refactor: remove never happning else * feat: enhance createDocumentationLink - Updated createDocumentationLink to accept query parameters * test: add unit tests for createDocumentationLink * fix: update urlTemplate for Homarr documentation
This commit is contained in:
@@ -3,5 +3,12 @@ import type { HomarrDocumentationPath } from "./homarr-docs-sitemap";
|
||||
const documentationBaseUrl = "https://homarr.dev";
|
||||
|
||||
// Please use the method so the path can be checked!
|
||||
export const createDocumentationLink = (path: HomarrDocumentationPath, hashTag?: `#${string}`) =>
|
||||
`${documentationBaseUrl}${path}${hashTag ?? ""}`;
|
||||
export const createDocumentationLink = (
|
||||
path: HomarrDocumentationPath,
|
||||
hashTag?: `#${string}`,
|
||||
queryParams?: Record<string, string>,
|
||||
) => {
|
||||
const url = `${documentationBaseUrl}${path}`;
|
||||
const params = queryParams ? `?${new URLSearchParams(queryParams)}` : "";
|
||||
return `${url}${params}${hashTag ?? ""}`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user