feat: integrate Cloudinary, add new fleet items and image gallery
This commit is contained in:
8
lib/cloudinary.ts
Normal file
8
lib/cloudinary.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
const CLOUDINARY_BASE = "https://res.cloudinary.com/du7xohbct/image/upload/aydogan";
|
||||
|
||||
export const cloudinaryUrl = (path: string) => {
|
||||
if (!path || !path.startsWith("/images/")) return path;
|
||||
const parts = path.replace("/images/", "").split("/");
|
||||
const encodedParts = parts.map(part => encodeURIComponent(part));
|
||||
return `${CLOUDINARY_BASE}/${encodedParts.join("/")}`;
|
||||
};
|
||||
Reference in New Issue
Block a user