Added fluid skills support

This commit is contained in:
2026-10-14 11:05:57 +02:00
parent 54c2d64cce
commit 0f073b963e
32 changed files with 280 additions and 42 deletions
+6 -1
View File
@@ -77,7 +77,12 @@ export const buildR2Storage = (
// (media.klient.pl → bucket) set R2_PUBLIC_URL so Payload generates URLs
// pointing there. Without it, uploads work but images don't display publicly.
// See docs/storage.md.
const publicUrl = process.env.R2_PUBLIC_URL?.replace(/\/$/, '') // strip trailing slash
// Site-relative value ('/media', dev only — ipalEnvRules rejects it in production)
// → prefixed with NEXT_PUBLIC_SERVER_URL so Payload still stores absolute URLs.
const rawPublicUrl = process.env.R2_PUBLIC_URL?.trim().replace(/\/$/, '') // strip trailing slash
const serverUrl = process.env.NEXT_PUBLIC_SERVER_URL?.trim().replace(/\/$/, '')
const publicUrl =
rawPublicUrl?.startsWith('/') && serverUrl ? `${serverUrl}${rawPublicUrl}` : rawPublicUrl
// generateFileURL is a PER-COLLECTION option in @payloadcms/storage-s3 (not a
// top-level one) — R2 needs it to point served URLs at the custom domain