mirror of
https://github.com/getzola/zola
synced 2025-01-05 16:38:50 +00:00
309 lines
18 KiB
HTML
309 lines
18 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en-gb">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="description" content="Everything you need to make a static site engine in one binary.">
|
|
<meta name="author" content="Vincent Prouillet">
|
|
<title>Cloudflare Pages | Zola </title>
|
|
<link rel="stylesheet" href="https://www.getzola.org/site.css">
|
|
<link rel="icon" href="https://www.getzola.org/favicon.ico">
|
|
</head>
|
|
<body>
|
|
|
|
<header>
|
|
<a class="header__logo white" href="https://www.getzola.org/">Zola</a>
|
|
<nav>
|
|
<ul>
|
|
<li><a class="white" href="https://www.getzola.org/documentation/" class="nav-link">Docs</a></li>
|
|
<li><a class="white" href="https://www.getzola.org/themes/" class="nav-link">Themes</a></li>
|
|
<li><a class="white" href="https://zola.discourse.group/" class="nav-link">Forum</a></li>
|
|
<li><a class="white" href="https://github.com/getzola/zola" class="nav-link">GitHub</a></li>
|
|
</ul>
|
|
<div class="search-container">
|
|
<input id="search" type="search" placeholder="🔎 Search the docs">
|
|
|
|
<div class="search-results">
|
|
<div class="search-results__items"></div>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
</header>
|
|
|
|
<div class="content content--reversed">
|
|
|
|
|
|
<div class="documentation">
|
|
<aside class="documentation__sidebar">
|
|
<ul>
|
|
|
|
|
|
<li>
|
|
<span class="documentation__sidebar__title">Getting Started</span>
|
|
<ul>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/getting-started/overview/">Overview</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/getting-started/installation/">Installation</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/getting-started/cli-usage/">CLI usage</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/getting-started/directory-structure/">Directory structure</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/getting-started/configuration/">Configuration</a>
|
|
</li>
|
|
|
|
</ul>
|
|
</li>
|
|
|
|
|
|
<li>
|
|
<span class="documentation__sidebar__title">Content</span>
|
|
<ul>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/content/overview/">Overview</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/content/section/">Section</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/content/page/">Page</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/content/shortcodes/">Shortcodes</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/content/linking/">Internal links & deep linking</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/content/table-of-contents/">Table of Contents</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/content/syntax-highlighting/">Syntax Highlighting</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/content/taxonomies/">Taxonomies</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/content/search/">Search</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/content/sass/">Sass</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/content/image-processing/">Image processing</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/content/multilingual/">Multilingual sites</a>
|
|
</li>
|
|
|
|
</ul>
|
|
</li>
|
|
|
|
|
|
<li>
|
|
<span class="documentation__sidebar__title">Templates</span>
|
|
<ul>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/templates/overview/">Overview</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/templates/pages-sections/">Sections and Pages</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/templates/pagination/">Pagination</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/templates/taxonomies/">Taxonomies</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/templates/feeds/">Feeds</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/templates/sitemap/">Sitemap</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/templates/robots/">Robots.txt</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/templates/404/">404 error page</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/templates/archive/">Archive</a>
|
|
</li>
|
|
|
|
</ul>
|
|
</li>
|
|
|
|
|
|
<li>
|
|
<span class="documentation__sidebar__title">Themes</span>
|
|
<ul>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/themes/overview/">Overview</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/themes/installing-and-using-themes/">Installing & using themes</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/themes/creating-a-theme/">Creating a theme</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/themes/extending-a-theme/">Customizing a theme</a>
|
|
</li>
|
|
|
|
</ul>
|
|
</li>
|
|
|
|
|
|
<li>
|
|
<span class="documentation__sidebar__title">Deployment</span>
|
|
<ul>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/deployment/overview/">Overview</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/deployment/sourcehut/">Sourcehut Pages</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/deployment/netlify/">Netlify</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/deployment/github-pages/">GitHub Pages</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/deployment/gitlab-pages/">GitLab Pages</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/deployment/codeberg-pages/">Codeberg Pages</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/deployment/edgio/">Edgio</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/deployment/vercel/">Vercel</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/deployment/zeabur/">Zeabur</a>
|
|
</li>
|
|
|
|
<li class="active">
|
|
<a href="https://www.getzola.org/documentation/deployment/cloudflare-pages/">Cloudflare Pages</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/deployment/flyio/">Fly.io</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/deployment/aws-s3/">AWS S3 Bucket</a>
|
|
</li>
|
|
|
|
<li class="">
|
|
<a href="https://www.getzola.org/documentation/deployment/docker-image/">Docker image</a>
|
|
</li>
|
|
|
|
</ul>
|
|
</li>
|
|
|
|
</ul>
|
|
</aside>
|
|
<div class="documentation__content">
|
|
|
|
<h1>Cloudflare Pages</h1>
|
|
<p>Cloudflare is a cloud solutions provider with a huge proprietary content delivery network (CDN). Like Netlify or Vercel, Cloudflare Pages makes the deployment process flexible and easy. You can add a GitHub repo to the service and build & host Zola-based websites after each PR automatically.</p>
|
|
<h2 id="step-by-step"><a class="zola-anchor" href="#step-by-step" aria-label="Anchor link for: step-by-step">🔗</a>Step-by-step</h2>
|
|
<ol>
|
|
<li>Sign in or create a new Cloudflare account and choose <em>"Pages"</em> on the right nav column</li>
|
|
<li>Press the button <em>"Create a project"</em></li>
|
|
<li>Select the GitHub repo that contains your Zola website and connect it to Cloudflare Pages</li>
|
|
<li>Click <em>"Begin setup"</em></li>
|
|
<li>Enter your project name. Keep in mind that if you would like to use the default Pages domain (pages.dev), this will be your website's future URL ("yourprojectname.pages.dev"). Additionally, select a production branch.</li>
|
|
<li>In <em>Build settings</em>, select Zola as the <em>Framework preset</em>. <em>Build command</em> and <em>Build output directory</em> will be filled automatically.</li>
|
|
<li>Toggle <em>Environment variables</em> below and add <code>ZOLA_VERSION</code> as <em>a variable name</em>. Use <code>0.17.2</code> or a different Zola version as the <em>value</em>.</li>
|
|
<li>Finally, save and deploy.</li>
|
|
</ol>
|
|
<p>Your website is now built and deployed to Cloudflare's network! You can add a custom domain or modify settings in the Pages dashboard.</p>
|
|
<p>You may find documentation and guides like <a href="https://developers.cloudflare.com/pages/getting-started">Getting started with Cloudflare Pages</a> and
|
|
<a href="https://developers.cloudflare.com/pages/how-to/deploy-a-zola-site#deploying-with-cloudflare-pages">Deploying Zola with Cloudflare Pages</a> in the Developers portal.</p>
|
|
<h2 id="troubleshooting"><a class="zola-anchor" href="#troubleshooting" aria-label="Anchor link for: troubleshooting">🔗</a>Troubleshooting</h2>
|
|
<p>Some tips to help troubleshoot issues getting started with Cloudflare Pages.</p>
|
|
<h3 id="zola-not-found"><a class="zola-anchor" href="#zola-not-found" aria-label="Anchor link for: zola-not-found">🔗</a><code>zola: not found</code></h3>
|
|
<p>If you see build output that resembles something like this:</p>
|
|
<pre data-lang="sh" style="background-color:#383838;color:#e6e1dc;" class="language-sh "><code class="language-sh" data-lang="sh"><span>23:03:54.609 </span><span style="color:#cc7833;">></span><span> build
|
|
</span><span>23:03:54.609 </span><span style="color:#cc7833;">></span><span> zola build $</span><span style="color:#d0d0ff;">BUILD_OPTS </span><span style="color:#cc7833;">&& </span><span>npx tailwindcss</span><span style="font-style:italic;color:#fd971f;"> -i</span><span> ./public/input.css</span><span style="font-style:italic;color:#fd971f;"> -o</span><span> ./public/style.css</span><span style="font-style:italic;color:#fd971f;"> -m
|
|
</span><span>23:03:54.609
|
|
</span><span>23:03:54.621 sh: 1: zola: not found
|
|
</span><span>23:03:54.635 Failed: Error while executing user command. Exited with error code: 127
|
|
</span><span>23:03:54.644 Failed: build command exited with code: 1
|
|
</span><span>23:03:55.699 Failed: error occurred while running build command
|
|
</span></code></pre>
|
|
<p>Then it might be due to an <a href="https://github.com/cloudflare/pages-build-image/issues/3#issuecomment-1646873666">outstanding issue</a>. There are currently two recommended workarounds:</p>
|
|
<h4 id="change-the-build-system-version-to-v1"><a class="zola-anchor" href="#change-the-build-system-version-to-v1" aria-label="Anchor link for: change-the-build-system-version-to-v1">🔗</a>Change the <strong>build system version</strong> to <code>v1</code></h4>
|
|
<p>From within the workers & pages dash, go to the following:
|
|
<Your Project> Settings > Builds & deployments > Build system version > Configure build system</p>
|
|
<p>Then select <code>v1</code> and save.</p>
|
|
<h4 id="or-use-unstable-pre-build-environment-variable-asdf"><a class="zola-anchor" href="#or-use-unstable-pre-build-environment-variable-asdf" aria-label="Anchor link for: or-use-unstable-pre-build-environment-variable-asdf">🔗</a>Or use <code>UNSTABLE_PRE_BUILD</code> environment variable + <code>asdf</code></h4>
|
|
<p>From within the workers & pages dash, do the following:
|
|
<Your Project> Settings > Environment variables > Edit variables</p>
|
|
<p>And add an environment variable <code>UNSTABLE_PRE_BUILD</code>, with the following value and save.</p>
|
|
<pre data-lang="sh" style="background-color:#383838;color:#e6e1dc;" class="language-sh "><code class="language-sh" data-lang="sh"><span>asdf plugin add zola https://github.com/salasrod/asdf-zola </span><span style="color:#cc7833;">&& </span><span>asdf install zola 0.18.0 </span><span style="color:#cc7833;">&& </span><span>asdf global zola 0.18.0
|
|
</span></code></pre>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<footer>
|
|
©2017-2024 — <a class="white" href="https://www.vincentprouillet.com">Vincent Prouillet</a> and <a class="white" href="https://github.com/getzola/zola/graphs/contributors">contributors</a>
|
|
</footer>
|
|
|
|
<script type="text/javascript" src="https://www.getzola.org/elasticlunr.min.js"></script>
|
|
<script type="text/javascript" src="https://www.getzola.org/search.js"></script>
|
|
</body>
|
|
</html>
|