Skip to content

feat(carousel): serve slide images from media, add picker to settings - #142

Merged
ssavutu merged 1 commit into
mainfrom
feat/carousel-media-images
Aug 1, 2026
Merged

feat(carousel): serve slide images from media, add picker to settings#142
ssavutu merged 1 commit into
mainfrom
feat/carousel-media-images

Conversation

@ssavutu

@ssavutu ssavutu commented Aug 1, 2026

Copy link
Copy Markdown
Member

Problem

The homepage carousel defaults pointed at /images/PodcastBanner.webp, /images/classifiedsBannerNew.webp, and /images/applyBannerNew.webp — files bundled in Scalene's public/images/, duplicated verbatim in Banner.astro's own fallback list.

  • Editors couldn't change them. Swapping a banner meant a Scalene commit + redeploy, defeating the point of a CMS-editable carousel.
  • Rename or drop a file on the Scalene side and the slide renders a broken <img>, with nothing in the CMS aware of it.
  • The settings field was plain text with no preview, and a root-relative /images/... resolves against the CMS origin, which serves nothing there.

Changes

Images moved to the media filesystem. The three banners now live at /mnt/cephfs/media/wp-content/uploads/scalene/ and the Go defaults point at them via defaultCarouselImageBase. The prefix sits under wp-content/ because that is the only tree Nginx roots (deploy/nginx/triangle-cms.conf) — a top-level dir would fall through to the frontend proxy and 404 — and outside the YYYY/MM layout so the legacy WP corpus stays visibly separate.

Media picker in settings. The Image URL input becomes an Image field with a thumbnail, a Choose/Replace button opening the existing MediaPicker modal (search + upload, same as the article editor), and Clear. The raw URL input stays for external URLs and for the empty-image_url case that drives Scalene's one-hundred-slide text slide.

Notes

  • No data migration needed. GET /v1/homepage returns a carousel byte-identical to the Go defaults, so no cms_settings row exists for homepage_carousel yet — the defaults are what the public homepage actually serves.
  • Files are already live and independent of this merge: all three return 200 image/webp at the expected sizes.
  • Don't overwrite these files in place. The /wp-content/ block stamps max-age=2592000, immutable, which assumes a filename pins its bytes — true for WP's size-suffixed derivatives, not for these. Replace under a new name and repoint the slide. Documented in a comment above the const.
  • The three files aren't in the media library DB (copied directly, bypassing POST /v1/media), so they serve fine but won't appear in the MediaPicker grid until a "Reindex Media" run.
  • Banner.astro's duplicated defaultSlides is intentionally untouched — it still falls back to the /images/ paths if the CMS returns an empty carousel.

Testing

go build, go vet, gofmt, go test -count=1 ./internal/..., tsc --noEmit, and npm run build all pass on this branch's base.

🤖 Generated with Claude Code

The homepage carousel defaults pointed at /images/PodcastBanner.webp and
friends -- files bundled in Scalene's public/images. Those paths could not
be changed from the CMS, so editing a banner meant a Scalene commit and
redeploy, which defeats the point of a CMS-editable carousel; a rename on
the Scalene side broke the slide with nothing in the CMS to show for it.
The settings field was also plain text with no preview, and a root-relative
/images/... would have resolved against the CMS origin, which serves
nothing there.

Copy the three banners to the media filesystem under
wp-content/uploads/scalene/ and repoint the defaults at them. The prefix
sits under wp-content because that is the only tree Nginx serves, and
outside the YYYY/MM layout so the legacy WP corpus stays separate.

Replace the Image URL input with a thumbnail plus the existing MediaPicker
modal, so slides can be pointed at library media or a fresh upload. The raw
URL input stays for external URLs and for the empty-image_url case that
drives Scalene's "100 Years" text slide.

No cms_settings row for homepage_carousel exists yet, so the defaults are
what the public homepage actually serves and no data migration is needed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ssavutu
ssavutu merged commit e69f52a into main Aug 1, 2026
6 checks passed
@ssavutu
ssavutu deleted the feat/carousel-media-images branch August 1, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant