Update documention for using zola + Cloudflare Pages per advice in https://github.com/cloudflare/pages-build-image/issues/3#issuecomment-1646873666 (#2364)

This commit is contained in:
Spencer Scorcelletti 2023-11-30 23:14:57 +01:00 committed by GitHub
parent 2774d4d410
commit c031cc592c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,3 +20,45 @@ Your website is now built and deployed to Cloudflare's network! You can add a cu
You may find documentation and guides like [Getting started with Cloudflare Pages](https://developers.cloudflare.com/pages/getting-started) and You may find documentation and guides like [Getting started with Cloudflare Pages](https://developers.cloudflare.com/pages/getting-started) and
[Deploying Zola with Cloudflare Pages](https://developers.cloudflare.com/pages/how-to/deploy-a-zola-site#deploying-with-cloudflare-pages) in the Developers portal. [Deploying Zola with Cloudflare Pages](https://developers.cloudflare.com/pages/how-to/deploy-a-zola-site#deploying-with-cloudflare-pages) in the Developers portal.
## Troubleshooting
Some tips to help troubleshoot issues getting started with Cloudflare Pages.
### `zola: not found`
If you see build output that resembles something like this:
```sh
23:03:54.609 > build
23:03:54.609 > zola build $BUILD_OPTS && npx tailwindcss -i ./public/input.css -o ./public/style.css -m
23:03:54.609
23:03:54.621 sh: 1: zola: not found
23:03:54.635 Failed: Error while executing user command. Exited with error code: 127
23:03:54.644 Failed: build command exited with code: 1
23:03:55.699 Failed: error occurred while running build command
```
Then it might be due to an [outstanding issue](https://github.com/cloudflare/pages-build-image/issues/3#issuecomment-1646873666). There are currently two recommended workarounds:
#### Change the **build system version** to `v1`
From within the workers & pages dash, go to the following:
<Your Project> Settings > Builds & deployments > Build system version > Configure build system
Then select `v1` and save.
#### Or use `UNSTABLE_PRE_BUILD` environment variable + `asdf`
From within the workers & pages dash, do the following:
<Your Project> Settings > Environment variables > Edit variables
And add an environment variable `UNSTABLE_PRE_BUILD`, with the following value and save.
```sh
asdf plugin add zola https://github.com/salasrod/asdf-zola && asdf install zola 0.17.2 && asdf global zola 0.17.2
```