Hugoが page reference is ambiguous で落ちた|カテゴリ名とタグ名を同じにしていた
記事を1本追加して hugo を叩いたら、ビルドごと落ちました。 ERROR error building site: render: failed to render pages: render of "/categories" failed: ".../themes/PaperMod/layouts/baseof.html:24:7": execute of template failed: template: taxonomy.html:24:7: executing "taxonomy.html" at <partialCached "header.html" . .Page>: error calling partialCached: ".../PaperMod/layouts/_partials/header.html:92:38": execute of template failed: template: _partials/header.html:92:38: executing "_partials/header.html" at <site.GetPage>: error calling GetPage: page reference "選び方" is ambiguous 追加した記事のフロントマターは、これでした。 categories: ["選び方"] tags: ["VPS", "さくらのVPS", "メモリ", "n8n", "Dify", "スペック", "選び方"] 選び方 をカテゴリとタグの両方に書いていました。 これだけです。 犯人はテーマのこの1行 _partials/header.html の92行目です。 {{- $is_search := eq (site.GetPage .KeyName).Layout `search` }} メニュー項目が検索ページかどうかを判定するために、site.GetPage を呼んでいます。 ...