Cloudflare Pages FAQ for Beginners

I have read a some of the Framework guides but I still need some help please.

  1. The guide prompts me to run Hugo on my local machine. This generates then saves the HTML into a ‘public’ directory within my Git repository. But, as I understand it, Cloudflare, at build time, will run its own copy of Hugo which uses my repo’s markdown files as the source. Why do I need to run Hugo locally?

  2. I am not using a framework but have my own single custom binary, say, ‘myGen’, which renders my site. I would like Cloudflare to run myGen, is this possible and how would I go about it?

You run locally just to verify the build output is the same. You do not commit the public folder and you don’t want to re-run it every time manually. We do indeed run the command and will take the contents to upload them.

If myGen is something like a bash file you can simply do ./myGen.sh. You can run it just like you would any other file in a Linux container. Just set it as your build command

2 Likes

myGen is an executable like Hugo written in Go. Is that still okay?

Yep. The build process is just a Linux container so you can run it like usual.

1 Like

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