Cloudflare PagesのHugoのビルドが失敗しちゃう(バージョン問題)

カテゴリ: 2025 技術 Tips
タグ: Cloudflare Hugo Web

テーマのアップデートとかをした後でCloudflare PagesでホストしているHugoビルドが失敗しちゃっている・・・

text
1
2
3
|   |   |
|---|---|
|01:40:44.001|Error: error building site: render: failed to render pages: render of "page" failed: "/opt/buildhome/repo/themes/LoveIt/layouts/_default/baseof.html:24:16": execute of template failed: template: _default/single.html:24:16: executing "_default/single.html" at <partial "header.html" .>: error calling partial: "/opt/buildhome/repo/themes/LoveIt/layouts/partials/header.html:60:23": execute of template failed: template: partials/header.html:60:23: executing "partials/header.html" at <hugo>: can't evaluate field IsMultilingual in type interface {}|

こういうエラーメッセージが出ていて、

検索をかけるとどうやらバージョンに関わるもの?みたい

https://discourse.gohugo.io/t/warn-deprecated-site-ismultilingual-was-deprecated-use-hugo-ismultilingual-instead/51007

で、ログに出ていたバージョンがこれ、

text
1
2
3
|   |   |
|---|---|
|01:40:43.291|hugo v0.118.2-da7983ac4b94d97d776d7c2405040de97e95c03d+extended linux/amd64 BuildDate=2023-08-31T11:23:51Z VendorInfo=gohugoio|

テーマの説明を再度確認しにいくとこれ

oh…no…バージョン足りない…

解決

https://developers.cloudflare.com/pages/framework-guides/deploy-a-hugo-site/

なんとHugoのバージョンを指定できるみたい!!!!

設定から変数でバージョンを指定してあげると・・・

動いたやったー!

プロフィール
プロフィール画像
名前
かもしか
色々やってみたい人です。そしてすべてが中途半端になった。
AboutMe

目次