Как исправить 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.


Check out similar posts by category: Python