This article show you how to deploy your site to Cloudflare Pages.

Creating a Project#

We’ll start by creating a Git project and filling in the appropriate information.

Build Command#

1npm i && hugo --gc --minify --enableGitInfo -b
  1. npm i is a shortcut to npm install, which installs the dependencies used during the site build.
  2. -b specifies baseURL, please replace it yourself. You can also save it to a configuration file instead of specifying it in the build command.

Environment Variables#


404 Page#

Cloudflare is smart enough to use the best matching 404 pages, even for multilingual sites, and works without additional configurations.