-
Notifications
You must be signed in to change notification settings - Fork 0
Deployment
PutOut generates a static site in the dist/ directory. It can be hosted on any static hosting platform.
This creates a new repo in your GitHub account, connects it to Netlify, and deploys automatically.
-
Push your project to GitHub.
-
Create a new site on Netlify and connect your GitHub repository.
-
Build settings are pre-configured in
netlify.toml:[build] publish = "dist" command = "npm run build"
-
Netlify will automatically build and deploy on every push.
-
In Netlify, go to Site settings → Domain management → Add custom domain
-
Enter your domain (e.g.
mybook.com) -
Follow Netlify's instructions to update your DNS records (usually adding a CNAME or A record)
-
Netlify automatically provisions an SSL certificate — your site will be available at
https://yourdomain.com -
Important: Update
urlinsrc/_data/site.jsto match your custom domain, then push the change:url: "https://mybook.com",
The included netlify.toml sets up:
-
Build command:
npm run build(site + styles + PDF/EPUB) -
Publish directory:
dist/ -
404 handling: Redirects unknown routes to
/404.htmlwith a 404 status
- Import your GitHub repo on Vercel.
- Configure the build settings:
-
Build command:
npm run build -
Output directory:
dist
-
Build command:
- Click Deploy. Vercel will build and deploy automatically on every push.
For a custom domain, add it in Vercel's project settings under Domains and update your DNS records. Don't forget to update url in site.js to match.
You can deploy to GitHub Pages using GitHub Actions. Add this workflow file to your repository:
-
Create
.github/workflows/deploy.yml:name: Deploy to GitHub Pages on: push: branches: [main] permissions: contents: read pages: write id-token: write jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 20 - run: npm ci # Install Chromium dependencies for PDF generation - run: sudo apt-get update && sudo apt-get install -y chromium-browser - run: npm run build - uses: actions/upload-pages-artifact@v3 with: path: dist deploy: needs: build runs-on: ubuntu-latest environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} steps: - id: deployment uses: actions/deploy-pages@v4
-
In your GitHub repo settings, go to Pages and set the source to GitHub Actions.
-
Update
urlinsite.jsto your GitHub Pages URL:url: "https://yourusername.github.io/your-repo-name",
-
Push the workflow file. GitHub will build and deploy automatically.
Note: The workflow includes Chromium installation for PDF generation. If you don't need PDF/EPUB, you can remove the apt-get line.
- Connect your repo on Cloudflare Pages.
- Set build command to
npm run buildand output directory todist.
Build locally and upload the dist/ folder to any web server:
npm run build
# Upload dist/ to your serverOnce your site is live, take these steps:
Make sure url in src/_data/site.js is set to your actual domain. This is critical for your sitemap, social sharing previews, and search engine indexing:
url: "https://mybook.com",Paste one of your page URLs into these tools to verify the preview looks correct:
You should see your book title, description, and cover image.
Visit https://yourdomain.com/sitemap.xml in a browser to confirm it lists all your pages with the correct URLs.
Submit your sitemap URL to Google Search Console and Bing Webmaster Tools to speed up indexing.
If you created your site using the "Use this template" button, you can pull updates from the original repo:
# Add the template as a remote (once)
git remote add template https://github.com/deepakness/putout.git
# Fetch and merge updates
git fetch template
git merge template/main --allow-unrelated-histories
# Resolve any conflicts, then push
git add .
git commit -m "Merged updates from template"
git push origin main- Configuration — Setting your URL and other options
- SEO and Structured Data — How your URL affects SEO
- PDF and EPUB — CI setup for PDF generation