Creator portfolio with Astro and Sanity on Netlify
For creators and freelancers who need a portfolio with case studies and rich media, easy client previews, and no database server.
This recipe is assembled from official documentation and was not built end to end for this page.
The parts
| Role | Tool | Why |
|---|---|---|
| Framework | Astro | Astro renders lightweight static HTML by default and optimizes Core Web Vitals for media-rich portfolio layouts. |
| CMS | Sanity | Sanity provides a headless CMS with structured content editing and a free plan for individual creators. |
| Hosting | Netlify | Netlify automates continuous Git deployments and deploy previews for every change. |
Why this stack fits
A creator portfolio needs sharp visuals, fast image loading, and easy content updates. Astro, Sanity, and Netlify balance developer control with editing that clients can handle.
Astro is the base web framework. As detailed on the Astro official website and the Astro getting started guide, Astro compiles templates directly into static HTML by default, stripping away unnecessary client-side JavaScript. This helps high-resolution project photography and design work load fast without blocking browser rendering.
Sanity is a composable headless content platform. According to the Sanity official website and Sanity documentation, Sanity provides structured content modeling and a customizable editing workspace. This lets creators, photographers, and writers upload assets, update copy, and manage project galleries through a visual interface without touching project source code.
Netlify provides automated hosting and global edge delivery. As outlined in the Netlify documentation and on the Netlify official website, Netlify handles continuous deployment straight from Git repositories. Each push to Git or webhook trigger creates a deterministic build, while deploy previews provide shareable staging URLs to review work before publishing.
How the components connect
The workflow connects headless content editing to a static site build pipeline:
- Content authoring: Editors create or update portfolio projects, case studies, and image galleries in the Sanity Studio interface.
- Build-time querying: During deployment, Astro executes data-fetching queries using GROQ through the Sanity client library. Astro retrieves the structured content and compiles every project into optimized, static HTML and CSS files.
- Automated deployment: Netlify listens to repository commits. When Sanity calls a Netlify build hook after content is published, Netlify runs
astro buildand distributes the output directory across its global content delivery network.
What it costs to run
This stack has little ongoing cost:
- Astro: Fully open source under the MIT license, incurring zero licensing fees (Astro License).
- Sanity: Operates on a freemium model. Its free plan includes up to 20 user seats (Sanity Pricing).
- Netlify: Operates on a freemium model. Its free tier provides monthly build credits, bandwidth allowances, and SSL for custom domains (Netlify Pricing).
For individual creators, solo freelancers, and boutique studios, the included allowances on both Sanity and Netlify let the portfolio run at no monthly software cost at typical traffic levels.
When to pick something else
This architecture suits creative professionals, but other tools fit some needs:
- Cloudflare Pages: If your portfolio may get heavy traffic, Cloudflare Pages provides static hosting with unlimited bandwidth on its free plan.
- Vercel: If your project integrates deeply with Next.js or requires preview URLs for every branch, Vercel offers an alternative frontend cloud with deployment previews (Vercel Pricing).
- Local Markdown or MDX: If the site owner is a solo developer comfortable editing Markdown files and committing code directly to Git, eliminating Sanity in favor of Astro native content collections simplifies the stack by keeping all content in version control.
Setup steps
- Scaffold a new Astro project locally using npm create astro@latest.
- Create a Sanity project and configure content schemas for portfolio case studies and media assets.
- Install the official Sanity client or integration into the Astro project to fetch structured case study entries at build time.
- Create Astro templates and pages in src/pages/ to render case studies as static HTML.
- Connect the repository to Netlify for automated Git-triggered deployments and preview URLs.
- Create a build hook in Netlify, then add its URL as a webhook in Sanity so that publishing a portfolio item triggers a site rebuild.
Tradeoffs
- Statically generated project pages require a build step to reflect changes unless configured with dynamic server-side rendering or on-demand revalidation.
- Sanity content modeling requires understanding schema definitions and GROQ queries rather than a traditional drag-and-drop page builder.
- Netlify free builds are subject to monthly build credit quotas.
Swap options
Hosting: Cloudflare Pages, Vercel. Swap to Cloudflare Pages for unlimited bandwidth on its free plan or to Vercel for deep Next.js and frontend tooling ecosystem integration.