blogdown::serve_site()无法生成模板站点

2guxujil  于 2023-01-28  发布在  其他
关注(0)|答案(1)|浏览(148)

我已经按照here的说明安装了R blogdown软件包并运行了我的新站点。当我运行serve_site()时,我得到了下面的错误消息:

Launching the server via the command:
  C:/Users/xxxxx/AppData/Roaming/Hugo/0.91.0/hugo.exe server --bind 127.0.0.1 -p 4321 --themesDir themes -t starter-hugo-academic -D -F --navigateToChanged
Error: Error building site: failed to render pages: render of "page" failed: execute of template failed: template: book/single.html:5:3: executing "book/single.html" at <partial "site_head" .>: error calling partial: "C:\Users\em14031\OneDrive - AUT University\Personal_website\themes\github.com\wowchemy\wowchemy-hugo-modules\wowchemy\v5\layouts\partials\site_head.html:208:13": execute of template failed: template: partials/site_head.html:208:13: executing "partials/site_head.html" at <getenv "WC_POST_CSS">: error calling getenv: access denied: "WC_POST_CSS" is not whitelisted in policy "security.funcs.getenv"; 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 = ['.*']

看起来有一些安全配置文件需要编辑,但是我在项目的“~/config/_default”中找不到它。你知道这个文件可能在哪里吗?
多谢了!

f45qwnt8

f45qwnt81#

在您的网站项目中,配置文件是config/_default/config.yaml。添加

security:
  funcs:
    getenv:
      - ^HUGO_
      - ^WC_

以将环境变量WC_POST_CSS列入白名单。

相关问题