Open13
Zola on cloudflare
Env
- macOS Ventura 13.6.4
- Macbook pro M2
Install
brew install zola
Create project
zola init zola-com4dc-project
Welcome to Zola!
Please answer a few questions to get started quickly.
Any choices made can be changed by modifying the `config.toml` file later.
> What is the URL of your site? (https://example.com):
> Do you want to enable Sass compilation? [Y/n]: Y
> Do you want to enable syntax highlighting? [y/N]: y
> Do you want to build a search index of the content? [y/N]: y
Done! Your site was created in /Users/hoge/zola-com4dc-project
Get started by moving into the directory and using the built-in server: `zola serve`
Visit https://www.getzola.org for the full documentation.
Create Github Repository
- 適当なRepositoryを作る
- zola-com4dc-project を関連づけてPush
-
static
,sass
,tempaltes
等は空ディレクトリなので.gitkeep
等を配置して Commit 対象にしておく
Cloudflare Dashboard
Pages
- Workers & Pages を選択
- Pages タブから Create application
- Github Repositoryに関連付け
Deploy Settings
- Framework から Zola を選択
- ビルド対象ブランチを
main
- ビルドコマンドを
zola biuld
- 生成物のディレクトリを
public
Build Error
どうも Build Version 2だと Zola が入っていないらしい。
一旦、エラーのままプロジェクトを進めてプロジェクト作成完了させてしまう
Fix Error
プロジェクトの Settings タブへ移動し、 Builds and Deployments
を選択する。
Build system version
の箇所でバージョンを変更できる。元々は 2
が選択されている。ここを 1
に変える
Rebuild
再度Rebuildするとビルドに成功し、ページが Publish される
感触
Zola そのものは手軽で良さそうなのだが、Cloudflare の最新の Build System に組み込まれていないというのが気になった。Version 1で動くには動くのだが、そのうちなくなりそうだしどうしたものか。
Theme List