cloudflare / pages-build-image

Apache License 2.0
45 stars 1 forks source link

v2 build system breaking Zola sites #3

Open asimpletune opened 1 year ago

asimpletune commented 1 year ago

Zola is no longer offered by default by the new build system and it is causing new user's sites to break.

Would it be possible to make zola one of the preinstalled tools? I didn't see a public facing repo so I can't submit a PR myself.

In the meanwhile, I'd like to submit a PR to update Cloudflare's Zola documentation. Is the correct way to use v2 Pages build without preinstalled tools to have zola specified as a dependency in a cargo.toml file?

Keats commented 1 year ago

zola specified as a dependency in a cargo.toml file?

Zola is not on crates.io

asimpletune commented 1 year ago

Thanks @Keats I updated my comment

jrf0110 commented 1 year ago

@asimpletune Apologies for the issues using the v2 build image. I'll look into adding Zola.

As a workaround, you can leverage asdf in your build command (or the UNSTABLE_PRE_BUILD env var) and install the zola plugin and version there by prefixing your build command with this rather lengthy set of commands:

asdf plugin add zola https://github.com/salasrod/asdf-zola && asdf install zola 0.17.2 &&  asdf global zola 0.17.2 &&
Keats commented 8 months ago

Has it been added in the end?

asimpletune commented 8 months ago

It has not https://developers.cloudflare.com/pages/platform/language-support-and-tools/#supported-languages-and-tools

ekse commented 4 months ago

For others trying to get their zola site working on Cloudflare pages, I tried both methods listed on https://www.getzola.org/documentation/deployment/cloudflare-pages/#troubleshooting and they didn't work for me.

The way I got it to work was by putting a copy of the zola binary in my git repository (the x8664-unknown-linux-gnu from the release assets) and changing the build command to chmod +x zola && ./zola build on the Cloudflare Pages settings page. It's not pretty but it works ¯_(ツ)/¯.

PR-1-SM commented 3 months ago

I unzipped zola-v0.18.0-x86_64-unknown-linux-gnu.tar.gz in the release, installed the binary zola in the repository, and built it using the command specified. chmod +x zola && ./zola build

But the following error message occurred. 191 Error: config.toml not found in current directory or ancestors, current_dir is /opt/buildhome/repo

So I added the config.toml that I had been using with zola in the same location, and the installation completed successfully.

xpe commented 2 months ago

Since I use macOS, I cross-compiled Zola for x86 using the cross crate and put the executable into bin/x86_64-unknown-linux-gnu.

Then I configured Cloudflare to run: bin/x86_64-unknown-linux-gnu/zola build. It works fine!

image

FWIW, I didn't need the chmod +x. Nor did I have to do anything different with config.toml as mentioned above by PR-1-SM.

pimoore commented 2 months ago

@asimpletune Apologies for the issues using the v2 build image. I'll look into adding Zola.

As a workaround, you can leverage asdf in your build command (or the UNSTABLE_PRE_BUILD env var) and install the zola plugin and version there by prefixing your build command with this rather lengthy set of commands:


asdf plugin add zola https://github.com/salasrod/asdf-zola && asdf install zola 0.17.2 &&  asdf global zola 0.17.2 &&

Is there any ETR on when Zola will be added to the v2 build, so no workarounds are necessary?

Cc: @Keats