hugo 报错 rss.xml 找不到 email

服务器上的博客更新了一篇文章,但是在生成博客资源时,报错:

ERROR render of "section" failed: template: _internal/_default/rss.xml:3:9: executing "_internal/_default/rss.xml" at <site>: can't evaluate field email in type string

但是查看配置文件和 theme 的代码,并没有发现问题。到 hugoio 的论坛中找了一下,发现是配置文件中没配置对应的 email 信息导致的。

新的配置文件如下:

author:
  name: name
  email: xxxxxx@xxx.com

修改之后,需要同步修改 author.name 的获取方式:

.Site.Params.author.name

$author = .Site.Params.author
name = $author.name

将所有的模板同步修改之后,即可正常生成项目。