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 https://hbs-skeleton.pages.dev
  1. npm i is a shortcut to npm install, which installs the dependencies used during the site build.
  2. -b https://hbs-skeleton.pages.dev 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#

Name Value
HUGO_VERSION 0.101.0
NODE_VERSION 16

404 Page#

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