Cloudflare pages variable setup from local repository


I find it inconvenient to repeatedly set up variables every time I create a new website on Cloudflare. Much like Netlify, does Cloudflare offer the option to include variables such as HUGO_VERSION directly from the repository?

Netlify provides a file named netlify.toml where I can input custom variables. Upon deployment, Netlify automatically detects and adds or updates these environment variables. This feature is incredibly useful, especially since I’m using a Hugo theme that relies on a specific Hugo version. If I could set this variable in the theme locally, I wouldn’t have to set it up each time on Cloudflare Pages. Additionally, it’s challenging to remember the process of adding variables in Cloudflare Pages each time.

Is there any solution available to address this issue?

Thank you.

Hi @txp48my2v

Currently, Cloudflare Pages does not support setting environment variables through a configuration file like netlify.toml . You have to set them manually via the Cloudflare dashboard or the API. The Cloudflare team is aware of this limitation, and it may be addressed in the future.

You can now use wrangler.toml with Pages :slight_smile:

1 Like

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