Building and Deploying a Site
The scenario
Section titled “The scenario”“Build me a landing page / tool site / blog.” The hard part isn’t writing code — it’s getting something reachable at a URL.
The flow
Section titled “The flow”1. Pick a stack
Section titled “1. Pick a stack”| Need | Recommendation |
|---|---|
| Content sites, blogs, docs, tutorials | Static site generator (Astro / Next.js) |
| Interactive tools, small games | Frontend framework + static hosting |
| Database and auth | Full-stack framework + managed database |
Prefer static for content sites — fast, SEO-friendly, free to host.
2. Scaffold
Section titled “2. Scaffold”With Astro:
npm create astro@latest my-site -- --template starlight --install --no-git --yes3. Develop locally
Section titled “3. Develop locally”npm run devFocus on functionality and content here. Don’t polish pixels yet.
4. Build and smoke test
Section titled “4. Build and smoke test”npm run buildA clean build is the floor. Then smoke test:
- Does the homepage load?
- Do key pages return 200?
- Does navigation work?
Quick check:
for u in / /about/ /pricing/; do echo -n "$u -> " curl -s -o /dev/null -w "%{http_code}\n" "http://localhost:4321$u"doneDon’t loop over screenshot verification for visual details. Function first; visual issues are faster to catch by eye in a real browser.
5. Publish
Section titled “5. Publish”Static sites can be published to a live link directly:
Publish this project as an online link
You’ll get a shareable URL.
6. Custom domain
Section titled “6. Custom domain”Bind your domain on the hosting platform and add the DNS record (usually CNAME).
7. Indexing setup
Section titled “7. Indexing setup”Three things after launch:
- Submit your sitemap to search console / webmaster tools
- Wire up analytics
- Verify the SEO trio: sitemap, canonical, hreflang (for multilingual sites)
Mac-specific gotcha
Section titled “Mac-specific gotcha”npm commands get blocked
# On CODEBUDDY_BROKER_DENY:env -u NODE_OPTIONS npm installenv -u NODE_OPTIONS npm run buildNODE_OPTIONS has a shim injected. Independent of which node version you use — it’s the variable.
Also expect permission prompts on first write; allow always.
Multilingual structure
Section titled “Multilingual structure”For a bilingual site:
src/content/docs/├── index.mdx # default language (root /)├── getting-started/└── en/ # English at /en/ ├── index.mdx └── getting-started/Once configured, hreflang and canonical generate automatically. Every page needs its counterpart — missing ones render as untranslated placeholders.
Pre-launch checklist
Section titled “Pre-launch checklist”- Build with no errors
- All key pages return 200
- Mobile layout holds up
- Site title and description aren’t defaults
- Sitemap is reachable
- Analytics installed
- DNS resolved (if using a domain)