問題

--editor オプション付きで hugo new すると以下のエラーになってしまう。

% hugo new posts/2022/03/hoge/index.md --editor vim
Content "/path/to/hugo/content/posts/2022/03/hoge/index.md" created
Editing "/path/to/hugo/content/posts/2022/03/hoge/index.md" with "vim" ...
Error: access denied: "vim" is not whitelisted in policy "security.exec.allow"; 
the current security configuration is:

[security]
  enableInlineShortcodes = false
  [security.exec]
    allow = ['^dart-sass-embedded$', '^go$', '^npx$', '^postcss$']
    osEnv = ['(?i)^(PATH|PATHEXT|APPDATA|TMP|TEMP|TERM)$']

  [security.funcs]
    getenv = ['^HUGO_']

  [security.http]
    methods = ['(?i)GET|POST']
    urls = ['.*']

対応方法

以下の設定を confg.toml に追加する。

[security]
  [security.exec]
    allow = ['^vim$']

環境

% sw_vers
ProductName:    macOS
ProductVersion: 12.2
BuildVersion:   21D49

% hugo version
hugo v0.93.3+extended darwin/amd64 BuildDate=unknown