Hugo の access denied の修正方法: "asciidoctor" is not whitelisted in policy "security.exec.allow"; the current security configuration is:

問題:

Hugo ページをコンパイルすると、次のようなエラーメッセージが表示されます:

hugo_error_output.txt
ERROR render of "section" failed: "/home/uli/klc/themes/hugo-theme-techdoc/layouts/_default/list.html:3:4": execute of template failed: template: _default/list.html:3:4: executing "main" at <.Content>: error calling Content: "/home/uli/klc/content/footprint/F2/_index.adoc:1:1": access denied: "asciidoctor" is not whitelisted in policy "security.exec.allow"; the current security configuration is:

解決策

Hugo 設定ファイルを編集して、asciidoctor またはエラーの原因となったプログラムを実行許可プログラムのリストに追加する必要があります。

TOML 設定ファイルの場合、デフォルト値に asciidoctor を加えた次のセクションを追加します:

hugo-config.toml
[security]
    [security.exec]
    allow = ['^(dart-)?sass(-embedded)?$', '^go$', '^npx$', '^postcss$', '^asciidoctor$']

その後、Hugo ページを再コンパイルします。


同じカテゴリの類似記事をチェック: Python