Professional photography portfolio built with Astro and a manual photo library sync pipeline.
- Astro-based static site
- Manual photo pipeline with
sharpandexifr - Generated
src/data/photos.jsonmetadata - Responsive masonry archive
- Category filtering and lightbox viewer
Photo-Portfolio/
|-- assets/images/ # Raw source images by category
|-- public/photos/ # Optimized generated images
|-- scripts/generate-photos.mjs
|-- src/components/
|-- src/layouts/
|-- src/lib/
|-- src/pages/
|-- src/data/photos.json # Generated metadata
|-- public/styles/styles.css
`-- docs/
npm install- Sync photos when you add or update raw selections in
assets/images:
npm run prepare:photosThe command will ask which mode to use:
overwrite- replacepublic/photosentirely fromassets/imagesadd- add/update images by category and keep the current processed library
In add mode, any brand new category must contain at least 20 images.
- Start the Astro dev server:
npm run devThe site runs at http://localhost:4321.
npm run dev only starts the dev server. It does not process photos automatically.
The site data is built from public/photos, not directly from assets/images.
Build the site:
npm run buildPreview the production build:
npm run previewnpm run prepare:photos- Interactively syncassets/imagesintopublic/photosand rebuildsrc/data/photos.jsonfrom the processed librarynpm run dev- Start the Astro dev server onlynpm run build- Build the static sitenpm run preview- Preview the production build
- Cull and select new raw images into
assets/images/<category>/ - Run
npm run prepare:photos - Choose
addto append/update, oroverwriteto replace the processed library - Run
npm run devfor local work, ornpm run buildfor production output
Netlify is configured to publish dist/ using:
- Build command:
npm run build - Publish directory:
dist
If the processed library changes, run npm run prepare:photos before deploying so public/photos and src/data/photos.json stay in sync.
- Astro
- Sharp
- Exifr
- TypeScript support via Astro