浏览代码

publication archive: Fix error when no publications exist

George Cushen 7 年之前
父节点
当前提交
9e14c8a74e
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      layouts/section/publication.html

+ 2 - 0
layouts/section/publication.html

@@ -33,11 +33,13 @@
         <select class="pub-filters" data-filter-group="year">
           <option value="*">{{ i18n "filter_all" }}</option>
           {{ $years_sorted := $.Scratch.GetSortedMapValues "years" }}
+          {{ if $years_sorted }}
           {{ range $year := sort $years_sorted "" "desc" }}
           <option value=".year-{{ $year }}">
             {{ $year }}
           </option>
           {{ end }}
+          {{ end }}
         </select>
       </p>