Customize the “about” widget in hugo academic theme

心不动则不痛 提交于 2019-12-01 22:20:45

You can add another list of interests, but the theme doesn't know about the list you added. In the theme's source you'll find this section:

  {{ with $page.Params.interests }}
  <div class="col-sm-5">
    <h3>{{ i18n "interests" | markdownify }}</h3>
    <ul class="ul-interests">
      {{ range .interests }}
      <li>{{ . }}</li>
      {{ end }}
    </ul>
  </div>
  {{ end }}

https://github.com/gcushen/hugo-academic/blob/master/layouts/partials/widgets/about.html#L50-L59

Which renders an HTML section based on a predefined list.
You could try to copy/paste this section and change interests to your other_interests and see how it goes:

  {{ with $page.Params.other_interests }}
  <div class="col-sm-5">
    <h3>{{ i18n "interests" | markdownify }}</h3>
    <ul class="ul-interests">
      {{ range .other_interests }}
      <li>{{ . }}</li>
      {{ end }}
    </ul>
  </div>
  {{ end }}

I suggest reading up on templating in Hugo to get a better understanding of what's happening there. If you have more questions specific to this theme, maybe the source GitHub repository might be a good place to start.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!