












Generally it's pretty easy for static site generator users (see the official CloudFlare Pages doc!). Just authorize CloudFlare to your GitHub repository, fill in the build options, and let them deploy your site!
There's a few caveats though. Specifically, if you are using Hugo like me, the default version of Hugo in the build environment is pretty old and lacks a ton of features and bug fixes. So, you may want to specify a newer Hugo version by setting an environment variable. It should look like this:
|
|
Also, since I use postcss and autoprefixer, I also add the installation command for these to the build command. My build command looks like this:
|
|
If everything goes well, you should be able to see your site at the default pages.dev URL. Now, if you are satisfied with the result, just add a CNAME record that points to the site and Voilà! Your site should now be hosted on CloudFlare's global data centers.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。