Cloudflare Pages exploring


After a great HugoConf, I wanted to try Cloudflare Pages.
Using the Quickstart Guide and connecting GitHub → Cloudflare I have this error.
I used the ‘default’ theme of Ananke. Any pointers are greatly appreciated.
It does run on GitHub Pages… I do use a custom domain, is the problem there?

09:50:25.127 Cloning repository…
09:50:25.990 From GitHub - moorlag/cloudflaredemo
09:50:25.991 * branch 3db6459622775881d097ba8d8697a3202e083b14 → FETCH_HEAD
09:50:26.041 HEAD is now at 3db6459 remove
09:50:27.017 Submodule ‘themes/ananke’ (GitHub - theNewDynamic/gohugo-theme-ananke: Ananke: A theme for Hugo Sites) registered for path ‘themes/ananke’
09:50:27.018 Cloning into ‘/opt/buildhome/clone/themes/ananke’…
09:50:27.018 Submodule path ‘themes/ananke’: checked out ‘470ea40982f5036554819253c3ac6ed4a34193f4’
09:50:27.044 Success: Finished cloning repository files
09:50:27.626 Installing dependencies
09:50:27.637 Python version set to 2.7
09:50:30.735 v12.18.0 is already installed.
09:50:31.836 Now using node v12.18.0 (npm v6.14.4)
09:50:32.044 Started restoring cached build plugins
09:50:32.061 Finished restoring cached build plugins
09:50:32.517 Attempting ruby version 2.7.1, read from environment
09:50:35.974 Using ruby version 2.7.1
09:50:36.331 Using PHP version 5.6
09:50:36.483 5.2 is already installed.
09:50:36.509 Using Swift version 5.2
09:50:36.509 Installing Hugo 0.54.0
09:50:37.203 Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z
09:50:37.207 Started restoring cached go cache
09:50:37.227 Finished restoring cached go cache
09:50:37.364 go version go1.14.4 linux/amd64
09:50:37.382 go version go1.14.4 linux/amd64
09:50:37.385 Installing missing commands
09:50:37.385 Verify run directory
09:50:37.386 Executing user command: hugo
09:50:37.445 Error: /opt/buildhome/repo/themes/ananke/layouts/partials/func/GetFeaturedImage.html:41:1: parse failed: template: partials/func/GetFeaturedImage.html:41: function return not defined
09:50:37.453 Failed: build command exited with code: 255
09:50:38.136 Failed: an internal error occurred

I found a resource that’s helpful.
Deploy a Hugo site on Cloudlfare Pages.

Cloudflare Pages uses a very old version of Hugo, so it is advised to set the environment variable to a more recent version of Hugo, otherwise the build will fail.

1 Like

Here are my settings.

Screenshot from 2022-07-10 18-15-00

I hope it helps.

1 Like

Thanks @techmagus!
This solved the problem :slight_smile:

HUGO_VERSION 0.101.0 is online!
Screenshot 2022-07-11 at 10.34.24


This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.