我正在通过 R 在 R 中建立一个 Hugo 网站,主题学术hugodown
。在“关于”部分是一个名为“兴趣”的列,我想将其重命名为“工作”。
到目前为止我做了什么:
该content/authors/admin/_index.md
文件包含以下代码:
interests: # <- I want to rename this into 'work'
- Artificial Intelligence
- Computational Linguistics
- Information Retrieval
如果仅重命名此文件,则不会显示整个“兴趣”列。
还有另一个文件layouts/partial/widgets/about.html
包含以下代码:
{{ with $person.interests }}
<div class="col-md-5">
<h3>{{ i18n "interests" | markdownify }}</h3>
<ul class="ul-interests">
{{ range . }}
<li>{{ . | markdownify | emojify }}</li>
{{ end }}
</ul>
</div>
{{ end }}
除上述更改外,命名with $person.interests
为with $person.work
将再次显示该列,但仍称为“兴趣”。当另外将i18n "interests"
标签中<h3>
的i18n "work"
“兴趣”更改为标题时,将删除并且仅显示列的内容而没有标题。
似乎新的列名“work”必须在其他地方注册,然后才能正确显示。
任何帮助表示赞赏。