Skip to content
Snippets Groups Projects

fix: base url in header image

Merged Moritz Stückler requested to merge fix/base-url-in-header-image into main
1 file
+ 4
1
Compare changes
  • Side-by-side
  • Inline
+ 4
1
@@ -24,8 +24,11 @@ export const prefixWithBaseIfNotUrl = (
): string => {
if (baseUrl) {
const isExternalUrl = path.toLowerCase().startsWith("http");
const hasTrailingSlash = path.endsWith("/");
return isExternalUrl ? path : baseUrl + path;
return isExternalUrl
? path
: `${baseUrl}${hasTrailingSlash ? "" : "/"}${path}`;
}
return path;
};
Loading