mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
25 lines
623 B
TypeScript
25 lines
623 B
TypeScript
import isInternalUrl from "@docusaurus/isInternalUrl";
|
|
/**
|
|
* This function will generate rel attribute for links.
|
|
* @param {string} URL to be dest for link
|
|
*/
|
|
export const getLinkRel = (URL?: string): string => {
|
|
let rel = "noopener noreferrer nofollow";
|
|
|
|
const isInternalURL = isInternalUrl(URL);
|
|
|
|
if (URL?.includes("github.com/refinedev/refine")) {
|
|
rel = "noopener";
|
|
}
|
|
|
|
if (isInternalURL || URL?.includes("refine.dev")) {
|
|
rel = "noopener dofollow";
|
|
}
|
|
|
|
if (isInternalURL || URL?.includes("reactadminpanel.com")) {
|
|
rel = "noopener dofollow";
|
|
}
|
|
|
|
return rel;
|
|
};
|