Skip to content
Proyek

Tentang

Photo Portfolio w/ Next.js + TailwindCSS + Contentful

Desain dan media

Cara angka ini diukur

Pertumbuhan bintang terukur

dalam 24 jam
0
dalam 7 hari
0
dalam 15 hari
0
dalam 1 bulan
Mengumpulkan riwayat

Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.

README.md

Asli

jpvalery.photo

Photography portfolio of Jp Valery: chapters (bodies of work), the full archive of contact sheets, and a small blog.

A fully static Next.js site. Photos are resized once, on a laptop, and served from Cloudflare R2 at img.jpvalery.photo. Nothing is resized at request time, so there is no image-optimization bill to run up and no egress fee.

How it fits together

content/
  chapters/*.md            one file per chapter: title, description, cover, photos in order
  posts/*.md               blog posts; images are written ![alt](photo:<id>)
  pages/biography.md
  photos/library.json      every photo: id → source file, plus alt text / caption (edit by hand)
  photos/manifest.json     generated by photos:ingest (sizes, hashes, colours, EXIF)
  redirects/               old archive.jpvalery.photo/p/N links → photo ids
app/                       Next.js App Router, output: "export"
components/photo/Photo.tsx the only way photos are drawn: <picture> with AVIF/WebP srcsets
scripts/photos/            ingest, verify, backup
scripts/check/             cost guards, content validation, page-weight budget

Original files live outside the repo in $PHOTOS_SRC (default ~/Pictures/jpvalery-library) and are backed up to the private R2 bucket jpvalery-originals.

Common tasks

Task Command
Develop pnpm dev (set NEXT_PUBLIC_PHOTO_CDN_URL=http://localhost:4100 and run pnpm dlx serve .cache/cdn -l 4100 to use local variants)
Add photos Put files in $PHOTOS_SRC/local/, add entries to content/photos/library.json, then pnpm photos:ingest
Back up originals pnpm photos:backup
Check everything pnpm check
Build pnpm build (fails if anything would use Vercel's image optimizer or a retired image host)
Regenerate redirects pnpm gen:vercel

R2 credentials go in .env.r2 (see .env.r2.example). They stay on your machine; Vercel never needs them.

Cost guardrails

  • output: "export" and images.unoptimized: no functions, no optimizer.
  • Biome bans next/image, and scripts/check/guards.ts fails the build on next/image, /_next/image, Contentful, Cloudinary or r2.dev URLs.
  • Variant keys are content-hashed and served with Cache-Control: immutable, so Cloudflare's edge serves almost every request without touching R2.

Jelajahi proyek terkait

Memuat…