mirror of
https://github.com/10h30/blog-balodeplao.git
synced 2026-05-12 23:21:16 +09:00
feat: add R2 image handling and utility functions for image URLs
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
import { R2_BASE } from "@/config/r2.mjs";
|
||||
|
||||
export function toR2Url(path?: string): string | undefined {
|
||||
if (!path) return undefined;
|
||||
if (path.startsWith("http")) return path;
|
||||
return `${R2_BASE}${path}`;
|
||||
}
|
||||
Reference in New Issue
Block a user