Code & ship
Netlify
Hosting a static site with a preview link for every pull request
I use it every week, right now.
This site runs here. Every PR gets its own preview link, and all the redirects live in one file.
Use it when
- You host a static or mostly static site, like Astro
- You want a preview link for every pull request
Skip it when
- You need a long-running server
- You can't risk a free site going offline when credits run out
Hear when my tools change
No schedule, no filler. I send one email when I add a tool, drop one, or publish a new article.
How I use it
- One config file.
netlify.tomlholds the build command, about 30 redirects and a few headers. - Moving a blog. My old blog address is a domain alias on this site. Redirect rules send every old post address to its new home under /blog, so old links keep working.
- Deploy previews. Every pull request gets its own link. I read changes there before merging.
- Headers. Plain-text copies of posts get a
noindexheader, so search engines only show the real pages.
Getting started
- For a static Astro site you need no adapter. Commit a
netlify.tomlwithcommand = "npm run build"andpublish = "dist". - Install the CLI and log in:
npm install -g netlify-cli, thennetlify login. - Run
netlify initto connect your repo. Every push to main deploys, and every PR gets adeploy-preview-<n>link. - Add your domain under Domain management.
Tips that save time
- For a whole old domain, use a forced redirect:
301!in_redirectsorforce = trueinnetlify.toml. Without it, a real file at the old path wins over your rule. - You can’t add or remove a trailing slash with a redirect rule. It loops. Use the Pretty URLs setting instead.
- Previews don’t spend deploy credits, but each production deploy costs 15. On the Free plan, batch your merges.
$MY_VARinsidenetlify.tomlis not replaced with its value. Set secrets in the dashboard or CLI.
Watch out for
- The Free plan’s cap is hard. When the 300 credits run out, every site on the team goes offline until the next cycle.
- New free projects show a “Powered by Netlify” badge by default. You can turn it off per project.
- New teams start with private projects. Visitors need a Netlify login until you make the project public.
Pricing
Free has 300 credits a month as a hard cap. Personal is $9/month, Pro is $20/month. A production deploy costs 15 credits; previews don't cost deploy credits. Checked Dec 5, 2026. Current prices
History
- Nov 2026DailyRebuilt this site in Astro, still hosted here
No referral links on this page. No paid placement, no other tie to the maker. How I pick tools.