<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Diego A. Carrasco Gubernatis | Personal Website (Posts about cloudflare pages)</title><link>https://diegocarrasco.com/</link><description></description><atom:link href="https://diegocarrasco.com/categories/cloudflare-pages.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2026 &lt;a href="mailto:hi@diegocarrasco.com"&gt;Diego Carrasco G.&lt;/a&gt; </copyright><lastBuildDate>Sat, 11 Apr 2026 08:03:45 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>How to Deploy a Nikola Static Site on Cloudflare Pages: A Step-by-Step Guide</title><link>https://diegocarrasco.com/deploy-nikola-site-cloudflare-pages/</link><dc:creator>Diego Carrasco G.</dc:creator><description>&lt;div id="toc" class="toc"&gt;
&lt;div id="toctitle"&gt;Table of Contents&lt;/div&gt;
&lt;ul class="sectlevel0"&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/deploy-nikola-site-cloudflare-pages/#_context_nikola_static_site_generator"&gt;Context: Nikola Static Site Generator&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/deploy-nikola-site-cloudflare-pages/#_why_cloudflare_pages"&gt;Why Cloudflare Pages?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/deploy-nikola-site-cloudflare-pages/#_what_are_deploy_hooks_automatic_scheduled_posts_in_static_sites"&gt;What are Deploy Hooks? → Automatic scheduled posts in static sites!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/deploy-nikola-site-cloudflare-pages/#_step_by_step_guide_to_deploying_on_cloudflare_pages"&gt;Step-by-Step Guide to Deploying on Cloudflare Pages&lt;/a&gt;
&lt;ul class="sectlevel1"&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/deploy-nikola-site-cloudflare-pages/#_step_1_setting_up_your_environment"&gt;Step 1: Setting Up Your Environment&lt;/a&gt;
&lt;ul class="sectlevel2"&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/deploy-nikola-site-cloudflare-pages/#_sample_pipfile"&gt;Sample Pipfile&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/deploy-nikola-site-cloudflare-pages/#_configuring_asciidoc_in_nikola_optional"&gt;Configuring Asciidoc in Nikola (optional)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/deploy-nikola-site-cloudflare-pages/#_step_2_link_your_repository"&gt;Step 2: Link Your Repository&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/deploy-nikola-site-cloudflare-pages/#_references"&gt;References&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div id="preamble"&gt;
&lt;div class="sectionbody"&gt;
&lt;!-- toc disabled --&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 id="_context_nikola_static_site_generator" class="sect0"&gt;Context: Nikola Static Site Generator&lt;/h2&gt;
&lt;div class="paragraph"&gt;
&lt;p&gt;Static websites have become increasingly popular in the web development world for their speed, security, and simplicity. &lt;a href="https://getnikola.com"&gt;Nikola&lt;/a&gt;, a widely-used Python-based static site generator, facilitates the creation of content-rich yet lightweight websites.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="paragraph"&gt;
&lt;p&gt;You can use many markup-languages allowing you to choose the ones you like the most. You can even write some articles in Markdown, some in Asciidoc, some in reST and some in HTML, and Nikola will process them accordingly.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="paragraph"&gt;
&lt;p&gt;There are many other SSGs (Static Site Generators) out there, like &lt;a href="https://jekyllrb.com/"&gt;Jekyll&lt;/a&gt;, &lt;a href="https://gohugo.io/"&gt;Hugo&lt;/a&gt;, &lt;a href="https://www.11ty.dev/"&gt;Eleventy&lt;/a&gt;, &lt;a href="https://www.gatsbyjs.com/"&gt;Gatsby&lt;/a&gt;, &lt;a href="https://hexo.io/"&gt;Hexo&lt;/a&gt;, &lt;a href="https://www.mkdocs.org/"&gt;MkDocs&lt;/a&gt;, &lt;a href="https://www.pelicanblog.org/"&gt;Pelican&lt;/a&gt;, &lt;a href="https://www.zola.dev/"&gt;Zola&lt;/a&gt;, and many more. I’ve tried many of them (at list all them in the list above,) and I’ve found Nikola to be the best &lt;strong&gt;&lt;em&gt;for my needs&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="paragraph"&gt;
&lt;p&gt;Your needs might be different, so I encourage you to try them all and choose the one that fits you the best. If in doubt, I recommend you to start with Nikola.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="paragraph"&gt;
&lt;p&gt;If you write all your content in Markdown, you can write a couple of articles and try each framework out there. The only thing you may have to change is the metadata format.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="paragraph"&gt;
&lt;p&gt;Anyway, &lt;strong&gt;this article is not about Nikola, but about how to deploy a Nikola site on Cloudflare Pages&lt;/strong&gt;. and &lt;strong&gt;the steps described here can be applied to any other SSG&lt;/strong&gt;, as long as you use the correct file for their dependency manager.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="paragraph"&gt;
&lt;p&gt;There is a list of supported SSGs (Frameworks) in the &lt;a href="https://developers.cloudflare.com/pages/framework-guides/"&gt;Cloudflare Pages documentation&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="paragraph"&gt;
&lt;p&gt;Hosting options like &lt;a href="https://pages.github.com/"&gt;GitHub Pages&lt;/a&gt;, &lt;a href="https://docs.gitlab.com/ee/user/project/pages/"&gt;GitLab Pages&lt;/a&gt;, and &lt;a href="https://pages.cloudflare.com/"&gt;Cloudflare Pages&lt;/a&gt; provide free, reliable and fast platforms for these kind of sites.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id="_why_cloudflare_pages" class="sect0"&gt;Why Cloudflare Pages?&lt;/h2&gt;
&lt;div class="paragraph"&gt;
&lt;p&gt;&lt;strong&gt;Cloudflare Pages&lt;/strong&gt; stands out, in my opinion, for:&lt;/p&gt;
&lt;/div&gt;
&lt;div class="ulist"&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;its performance optimization and enhanced security (includes a basic WAF - Web Application Firewall - and DDoS protection),&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;its integration with their awesome DNS management,&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;integrated analytics (although with data for the last 30 days only),&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;its integration with Cloudflare CDN and proxy,&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;its free subdomain under &lt;code&gt;pages.dev&lt;/code&gt; (if you need one),&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;its free SSL certificate,&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;its multi-branch deployments (meaning you can deploy different branches to different subdomains and check if everything looks like you want before merging to master. You can also always re-deploy an old commit), and&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;its support for custom domains,&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class="paragraph"&gt;
&lt;p&gt;making it an excellent choice for hosting Nikola sites (or any kind of static sites, actually).&lt;/p&gt;
&lt;/div&gt;
&lt;div class="paragraph"&gt;
&lt;p&gt;But the main reason I chose Cloudflare Pages is that it has &lt;strong&gt;Deploy hooks&lt;/strong&gt;!&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id="_what_are_deploy_hooks_automatic_scheduled_posts_in_static_sites" class="sect0"&gt;What are Deploy Hooks? → Automatic scheduled posts in static sites!&lt;/h2&gt;
&lt;div class="paragraph"&gt;
&lt;p&gt;Deploy hooks are URLs that you can use to trigger a new deployment of your site. This is useful when you want to automate the deployment of your site, for example, when you push a new commit to your repository, or when you use Nikola to schedule posts in the future.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="paragraph"&gt;
&lt;p&gt;With deploy hooks I can set up a Zap in Zapier or a Flow in ActivePieces to trigger a rebuild of my site (event when there is no new commits to the repo) and, because of the date Nikola will publish automatically the new scheduled post.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="paragraph"&gt;
&lt;p&gt;&lt;strong&gt;Yes, I can have dynamism in my static site!&lt;/strong&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="paragraph"&gt;
&lt;p&gt;This means:&lt;/p&gt;
&lt;/div&gt;
&lt;div class="olist arabic"&gt;
&lt;ol class="arabic"&gt;
&lt;li&gt;
&lt;p&gt;I can schedule posts in the future (meaning I can write 4 articles in a week and publish them once a week at the right time. This is good for me because I often write in batches or spurts of energy, interests and time).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I can have a Zap (in Zapier) or a Flow (in ActionPieces) that will trigger a rebuild of my site every day at 10:00, so I can have a new post published every day at 10:00 (or 10:05, depending on the speed of the rebuild).&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;div class="paragraph"&gt;
&lt;p&gt;&lt;em&gt;I will get into more detail about this in a future post.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id="_step_by_step_guide_to_deploying_on_cloudflare_pages" class="sect0"&gt;Step-by-Step Guide to Deploying on Cloudflare Pages&lt;/h2&gt;
&lt;div class="sect1"&gt;
&lt;h3 id="_step_1_setting_up_your_environment"&gt;Step 1: Setting Up Your Environment&lt;/h3&gt;
&lt;div class="sectionbody"&gt;
&lt;div class="paragraph"&gt;
&lt;p&gt;A &lt;code&gt;Pipfile&lt;/code&gt; is essential for deploying on Cloudflare Pages, as it manages your Python dependencies.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="paragraph"&gt;
&lt;p&gt;This file’s contents will depend on the specific configurations and input formats of your Nikola site, such as Markdown, Asciidoc, or reST.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="paragraph"&gt;
&lt;p&gt;The &lt;code&gt;Pipfile&lt;/code&gt; is used by the &lt;a href="https://pipenv.pypa.io/en/latest/"&gt;Pipenv&lt;/a&gt; tool, which is used to manage Python dependencies and virtual environments.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="admonitionblock note"&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class="icon"&gt;
&lt;i class="fa icon-note" title="Note"&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class="content"&gt;
In this article I write also about a Gemfile, which is used by the &lt;a href="https://bundler.io/"&gt;Bundler&lt;/a&gt; tool, which is used to manage Ruby dependencies and virtual environments. I added this because I use asciidoctor (Ruby-based) to process my Asciidoc files.
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class="admonitionblock warning"&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td class="icon"&gt;
&lt;i class="fa icon-warning" title="Warning"&gt;&lt;/i&gt;
&lt;/td&gt;
&lt;td class="content"&gt;
&lt;strong&gt;Both files (Pipfile and Gemfile) have to be in the root of your repository.&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class="sect2"&gt;
&lt;h4 id="_sample_pipfile"&gt;Sample Pipfile&lt;/h4&gt;
&lt;div class="paragraph"&gt;
&lt;p&gt;This sample &lt;code&gt;Pipfile&lt;/code&gt; includes the dependencies for a Nikola site using Markdown and Asciidoc. You may update the versions as needed.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="listingblock"&gt;
&lt;div class="content"&gt;
&lt;pre class="pygments highlight"&gt;&lt;code data-lang="python"&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="tok-p"&gt;[[&lt;/span&gt;&lt;span class="tok-n"&gt;source&lt;/span&gt;&lt;span class="tok-p"&gt;]]&lt;/span&gt;
&lt;span class="tok-n"&gt;url&lt;/span&gt; &lt;span class="tok-o"&gt;=&lt;/span&gt; &lt;span class="tok-s1"&gt;'https://pypi.python.org/simple'&lt;/span&gt;
&lt;span class="tok-n"&gt;verify_ssl&lt;/span&gt; &lt;span class="tok-o"&gt;=&lt;/span&gt; &lt;span class="tok-n"&gt;true&lt;/span&gt;
&lt;span class="tok-n"&gt;name&lt;/span&gt; &lt;span class="tok-o"&gt;=&lt;/span&gt; &lt;span class="tok-s1"&gt;'pypi'&lt;/span&gt;

&lt;span class="tok-p"&gt;[&lt;/span&gt;&lt;span class="tok-n"&gt;requires&lt;/span&gt;&lt;span class="tok-p"&gt;]&lt;/span&gt;
&lt;span class="tok-n"&gt;python_version&lt;/span&gt; &lt;span class="tok-o"&gt;=&lt;/span&gt; &lt;span class="tok-s1"&gt;'3.7'&lt;/span&gt;

&lt;span class="tok-p"&gt;[&lt;/span&gt;&lt;span class="tok-n"&gt;packages&lt;/span&gt;&lt;span class="tok-p"&gt;]&lt;/span&gt;
&lt;span class="tok-n"&gt;Nikola&lt;/span&gt; &lt;span class="tok-o"&gt;=&lt;/span&gt; &lt;span class="tok-s1"&gt;'8.2.2'&lt;/span&gt;
&lt;span class="tok-n"&gt;markdown&lt;/span&gt; &lt;span class="tok-o"&gt;=&lt;/span&gt; &lt;span class="tok-s1"&gt;'3.3'&lt;/span&gt;
&lt;span class="tok-n"&gt;asciidoc&lt;/span&gt; &lt;span class="tok-o"&gt;=&lt;/span&gt; &lt;span class="tok-s1"&gt;'10.2.0'&lt;/span&gt;
&lt;span class="tok-n"&gt;pygments&lt;/span&gt; &lt;span class="tok-o"&gt;=&lt;/span&gt; &lt;span class="tok-s1"&gt;'2.13.0'&lt;/span&gt;
&lt;span class="tok-n"&gt;jinja2&lt;/span&gt; &lt;span class="tok-o"&gt;=&lt;/span&gt; &lt;span class="tok-s1"&gt;'3.1.2'&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="sect2"&gt;
&lt;h4 id="_configuring_asciidoc_in_nikola_optional"&gt;Configuring Asciidoc in Nikola (optional)&lt;/h4&gt;
&lt;div class="paragraph"&gt;
&lt;p&gt;Configuring Asciidoc in Nikola involves specifying the binary path and options in the &lt;code&gt;conf.py&lt;/code&gt; file.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="paragraph"&gt;
&lt;p&gt;In this case I want to use asciidoctor as the binary and I want to have a table of contents and use Font Awesome icons when processing the file.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="listingblock"&gt;
&lt;div class="content"&gt;
&lt;pre class="pygments highlight"&gt;&lt;code data-lang="python"&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="tok-n"&gt;ASCIIDOC_BINARY&lt;/span&gt; &lt;span class="tok-o"&gt;=&lt;/span&gt; &lt;span class="tok-s2"&gt;"asciidoctor"&lt;/span&gt;

&lt;span class="tok-c1"&gt;# Specify options to the asciidoc compiler (as a string).&lt;/span&gt;
&lt;span class="tok-n"&gt;ASCIIDOC_OPTIONS&lt;/span&gt; &lt;span class="tok-o"&gt;=&lt;/span&gt; &lt;span class="tok-s2"&gt;"-a toc -a icons=font -a icon-set=fa"&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="sect3"&gt;
&lt;h5 id="_sample_gemfile"&gt;Sample Gemfile&lt;/h5&gt;
&lt;div class="paragraph"&gt;
&lt;p&gt;For Nikola sites using Asciidoc, a &lt;code&gt;Gemfile&lt;/code&gt; is also required to ensure proper processing of Asciidoc files.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="listingblock"&gt;
&lt;div class="content"&gt;
&lt;pre class="pygments highlight"&gt;&lt;code data-lang="ruby"&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="tok-n"&gt;source&lt;/span&gt;&lt;span class="tok-w"&gt; &lt;/span&gt;&lt;span class="tok-s1"&gt;'https://rubygems.org'&lt;/span&gt;
&lt;span class="tok-n"&gt;gem&lt;/span&gt;&lt;span class="tok-w"&gt; &lt;/span&gt;&lt;span class="tok-s1"&gt;'asciidoctor'&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="sect1"&gt;
&lt;h3 id="_step_2_link_your_repository"&gt;Step 2: Link Your Repository&lt;/h3&gt;
&lt;div class="sectionbody"&gt;
&lt;div class="olist arabic"&gt;
&lt;ol class="arabic"&gt;
&lt;li&gt;
&lt;p&gt;Sign in to Cloudflare Pages.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Choose 'Workers and Pages' from the left sidebar.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click the tab 'Pages'.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Clock "Connect to Git" to connect your GitHub or GitLab account.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select the repository containing your Nikola site.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the build settings as per your project’s needs.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;hr&gt;
&lt;div class="paragraph"&gt;
&lt;p&gt;And that’s it!&lt;/p&gt;
&lt;/div&gt;
&lt;div class="paragraph"&gt;
&lt;p&gt;Happy deploying!&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 id="_references" class="sect0"&gt;References&lt;/h2&gt;
&lt;div class="ulist"&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://getnikola.com/documentation.html"&gt;Nikola documentation&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://developers.cloudflare.com/pages/"&gt;Cloudflare Pages docs&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><category>cloudflare pages</category><category>nikola</category><category>static site deployment</category><category>technical</category><category>web hosting</category><guid>deploy-nikola-site-cloudflare-pages</guid><pubDate>Thu, 07 Dec 2023 08:00:00 GMT</pubDate></item></channel></rss>