Hugo academic 0.3.0でPublication listにナンバリングを付ける

Hugo academicに対する一つの大きな不満として、Publication listにナンバリングがされていないことが挙げられる。 同様の不満をもつ他の方もいるようである。

github.com

ナンバリングするように無理やりテンプレートを変更したメモを残す。 なお私が使っているのは現行よりかなり古いHugo academic 0.3.0であるため、現行バージョンではうまく行かない可能性がある。

themes/academic/layouts/section/publication.htmlの50行目付近を

      <div id="container-publications">
          <ol reversed>

          {{ range .Pages.ByDate.Reverse }}

          {{ if .Params.publication_types }}
            {{ $.Scratch.Set "pubtype" (index .Params.publication_types 0) }}
          {{ else }}
            {{ $.Scratch.Set "pubtype" 0 }}
          {{ end }}
            <div class="grid-sizer col-lg-12 isotope-item pubtype-{{ $.Scratch.Get "pubtype" }} year-{{ .Date.Format "2006" }}" style="margin-left: 15px">
          <li>
            {{ if eq $.Params.view 1 }}
              {{ partial "li_list" . }}
            {{ else if eq $.Params.view 3 }}
              {{ partial "li_card" . }}
            {{ else if eq $.Params.view 4 }}
              {{ partial "li_citation" . }}
            {{ else }}
              {{ partial "li_compact" . }}
            {{ end }}
          </li>
        </div>
        {{ end }}
      </ol>

と書き換える。