2025年12月26日 星期五

在 Netlify 上放 quarto 原始檔案讓它 build 的方法

netlify.md

Fix option 1: Add package.json with plugin

From the root of your Quarto project (the same directory as netlify.toml):

  1. If you do not have package.json yet, create it with:

    npm init -y
  2. Install the Quarto Netlify plugin as a dependency:

    npm install --save-dev @quarto/netlify-plugin-quarto # or equivalently: # npm install -D @quarto/netlify-plugin-quarto

    This will add something like:

    { "devDependencies": { "@quarto/netlify-plugin-quarto": "^0.0.5" } }

    to package.json.[2][5][1]

  3. Ensure your netlify.toml in the repo root contains at least:

    [[plugins]] package = "@quarto/netlify-plugin-quarto" [build] command = "quarto render" publish = "_site"
  4. Commit package.json, package-lock.json (or pnpm-lock.yaml/yarn.lock), and netlify.toml, push to GitHub, and trigger a new deploy.[2][3]