Here’s how to create a Hugo blog using hugo-theme-bootstrap for rendering, GitHub for storage, and Cloudflare Pages for deployment.

Create GitHub repository

If you do not already have a GitHub account, sign up for one now.

Sign up for GitHub account

In a browser, visit the page https://github.com/razonyang/hugo-theme-bootstrap-skeleton.

hugo-theme-bootstrap-skeleton

Click the Use this template button.

Use this template

Select Create a new repository.

Create a new repository

Type a unique name. Select public or private, as you prefer. Click Create repository.

Create repository

In your new repository, edit go.mod.

Edit go mod

Replace the line:

module github.com/razonyang/hugo-theme-bootstrap-skeleton

with your repository, for example:

module github.com/systemhorse/demo24

Your repository name

Click Commit changes…

Commit changes

Type a commit message, then click Commit changes.

Commit message

Deploy to Cloudflare

If you do not already have one, create a Cloudflare account at https://dash.cloudflare.com/sign-up

Create a Cloudflare account

Select Workers & Pages > Pages > Connect to Git.

Connect to Git

Click Connect GitHub.

Connect GitHub

Click Install & Authorize.

Install & Authorize

Select the new GitHub repository that you created a moment ago, and click Begin setup.

Begin setup

On the Set up builds and deployments screen, provide the following information:

  • Production branch main
  • Framework preset Hugo
  • Build command hugo
  • Build directory public

Configure build

Click Save and Deploy.

Save and Deploy

You will see Cloudflare Pages building your site. After Cloudflare Pages has deployed your site, it will display your unique subdomain *.pages.dev.

Unique subdomain name

Edit config/_default/config.yaml and insert your Cloudflare baseURL.

Insert Cloudflare baseURL

When you commit the change in GitHub, it will automatically trigger a new deployment in Cloudflare Pages.