Skip to content

Commit

Permalink
Show papers in descending order
Browse files Browse the repository at this point in the history
  • Loading branch information
henrylee97 committed Sep 6, 2023
1 parent 623e15a commit b0de928
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions layouts/shortcodes/publication-list.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
{{ $data := index $.Site.Data.publications }}
{{ $raw := index $.Site.Data.publications }}

{{ range $key, $value := $data }}
{{ partial "hook/heading.html" (dict "level" 1 "text" $key "anchor" $key) }}
{{ $data := dict }}
{{ range $year, $papers := $raw }}
{{ $block := (dict "year" $year "papers" $papers) }}
{{ $data = merge $data (dict $year $block) }}
{{ end }}

{{ range $block := sort $data "year" "desc" }}

{{ partial "hook/heading.html" (dict "level" 1 "text" $block.year "anchor" $block.year) }}
<ul>
{{ range $value }}
{{ range $block.papers }}
<li>
<span class="fw-bold">{{ .title }}</span></br>
{{ partial "publication/authors.html" .authors }}</br>
{{ partial "publication/target.html" (dict "target" .target "year" $key) }}</br>
{{ partial "publication/target.html" (dict "target" .target "year" $block.year) }}</br>
{{ with .award }}{{ partial "publication/award.html" . }}</br>{{ end }}
{{ partial "publication/materials.html" .materials }}
</li>
</br>
{{ end}}
{{ end }}
</ul>

{{ end }}

0 comments on commit b0de928

Please sign in to comment.