Netlify
Deploy your Hwaro site to Netlify with automatic builds and global CDN.
Quick Start
Generate Config
hwaro tool platform netlify
This creates a netlify.toml with build settings, redirects from aliases, and cache headers.
Deploy via Git
- Push your repository to GitHub, GitLab, or Bitbucket
- Go to Netlify and click Add new site > Import an existing project
- Connect your repository
- Netlify will auto-detect
netlify.tomlsettings - Click Deploy site
Manual Configuration
If you prefer to configure manually instead of using the generator, create netlify.toml:
[build]
command = "hwaro build"
publish = "public"
[build.environment]
# Set environment variables as needed
Redirects
Page aliases defined in frontmatter are automatically included as 301 redirects when using hwaro tool platform netlify:
---
title: New Post
aliases:
- /old-url/
- /legacy/post/
---
Generates:
[[redirects]]
from = "/old-url/"
to = "/posts/new-post/"
status = 301
[[redirects]]
from = "/legacy/post/"
to = "/posts/new-post/"
status = 301
Custom Domain
- Go to Site settings > Domain management
- Click Add custom domain
- Follow the DNS configuration instructions
- Update
base_urlinconfig.toml:
base_url = "https://www.yourdomain.com"
Deploy Previews
Netlify automatically creates deploy previews for pull requests. Preview builds use a temporary URL, so override the base URL using a deploy context:
[context.deploy-preview]
command = "hwaro build --base-url $DEPLOY_PRIME_URL"
$DEPLOY_PRIME_URL is a Netlify-provided environment variable containing the unique preview URL (e.g., https://deploy-preview-42--your-site.netlify.app).
See Also
- Platform Config Generator — Detailed generator options
- CLI Reference — All tool commands
- Other platforms: Vercel | Cloudflare Pages | GitHub Pages