2 minutes
Using Cloudflare Pages with hugo
In my previous post, I wrote about how I decided to go with hugo for this site.
This week, Cloudflare released Pages as GA and as I was still indecisive on how to host this site, gave it a go. Here is my rundown.
According to the developer docs, Pages enables you to deploy front-end applications. The deploy is what got me. From the start, Pages supports a lot of frameworks natively. To name a few: Angular, Blazor, React, Vue … The list goes on incl. Hugo and uploading a static site directly.
Now what does Cloudflare mean by supporting frameworks?
Currently, the Github and Gitlab are supported as SCM platforms. Pages hooks up to your repository and monitors it for changes. Development branches are supported as well. Upon selecting a framework, Pages runs the build script for the particular framework. Once that is succesfull, it deploys the result to Cloudflare edge nodes.
This deployment is available under a subdomain of pages.dev, which is configurable. A custom domain can be associated as well.
Deploying from a development branch can provide random subdomains of the deployment domain. These can be protected by Cloudflare Access to only provide users of your Cloudflare Account access to these preview pages.
Easy, fast, and highly available.
Checkout the Cloudflare Pages Getting started documentation for a more detailed setup.