Why Netlify?
Netlify offers several advantages for Nuxt applications:- Automatic deployments from Git
- Built-in CI/CD pipeline
- Global CDN distribution
- Automatic HTTPS/SSL certificates
- Instant cache invalidation
- Preview deployments for pull requests
- Excellent static site hosting performance
Deployment Methods
Method 1: Deploy via Git (Recommended)
Connect to Netlify
- Go to Netlify
- Click “Add new site” → “Import an existing project”
- Choose your Git provider (GitHub, GitLab, or Bitbucket)
- Authorize Netlify to access your repositories
- Select your portfolio repository
Configure Build Settings
Use the following build settings:Build command:Publish directory:Base directory: (leave empty)These settings tell Netlify to:
- Run static site generation
- Serve files from the
.output/publicdirectory
Method 2: Deploy via Netlify CLI
Configuration
netlify.toml (Optional)
While not required for this project, you can add anetlify.toml file to the root of your repository for more control:
Environment Variables
If your application uses environment variables:- Go to Site settings → Environment variables
- Click “Add a variable”
- Add your variables (e.g., API keys, analytics IDs)
- Redeploy your site
The current deployment includes Google Analytics (ID:
G-8H48RCN70L) configured in nuxt.config.ts. No additional environment variables are needed.Custom Domain Setup
The portfolio is deployed atguillaume-cazin.fr. To set up a custom domain:
Add Domain in Netlify
- Go to Site settings → Domain management
- Click “Add custom domain”
- Enter your domain (e.g.,
guillaume-cazin.fr) - Click “Verify”
Configure DNS
Update your domain’s DNS settings with your provider:For apex domain (guillaume-cazin.fr):For www subdomain:
Deployment Status
Monitor your deployments with the Netlify status badge. The current status is:Automatic Deployments
Once connected to Git, Netlify automatically deploys when:- You push to your main branch (production deployment)
- You create a pull request (preview deployment)
- You push to any branch (branch deployment, if enabled)
Deploy Previews
Every pull request gets a unique preview URL:- Test changes before merging
- Share with team members or clients
- Automatic cleanup after PR is closed
Post-Deployment Checks
After deployment, verify:Site Functionality
Site Functionality
- All pages load correctly
- Navigation works properly
- Light/dark mode toggle functions
- Contact form submissions work
- Images load and are optimized
SEO & Performance
SEO & Performance
- Sitemap is accessible at
/sitemap.xml - Meta tags are correct
- Google Analytics is tracking
- Lighthouse score is good (90+)
Security Headers
Security Headers
- HTTPS is enabled
- Security headers are set
- Mixed content warnings are resolved
Troubleshooting
Build Fails on Netlify
- Check the build logs in Netlify dashboard
- Ensure
package.jsonhas the correct build command - Verify Node.js version compatibility:
404 Errors
If you get 404 errors on page refresh:-
Add a
_redirectsfile to yourpublicfolder: -
Or use
netlify.tomlwith redirect rules (shown above)
Images Not Loading
- Ensure images are in the
publicdirectory - Check image paths are absolute (e.g.,
/images/photo.webp) - Verify Sharp is installed for image optimization:
Performance Optimization
Enable Asset Optimization
Netlify automatically minifies CSS and JS. Enable in Site settings → Build & deploy → Asset optimization.
Configure Caching
Netlify automatically caches assets. Configure cache headers in
netlify.toml for fine-grained control.Use Netlify Image CDN
Leverage Netlify’s image CDN for automatic image optimization and transformation.
Enable Prerendering
The
nuxt generate command prerenders all routes for maximum performance.Next Steps
Set Up Analytics
Monitor your site traffic with Netlify Analytics
Add Forms
Use Netlify Forms for contact form handling
Set Up Functions
Add serverless functions for dynamic features
Configure Webhooks
Trigger builds from external services