Skip to content

Commit d742c39

Browse files
committed
feat: support yearly sorting
1 parent cd3c349 commit d742c39

File tree

2 files changed

+24
-18
lines changed

2 files changed

+24
-18
lines changed

Diff for: content/authors/hyungseok/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ role: Ph.D '23, Samsung Research America
1212
highlight_name: true
1313
weight: 2023
1414

15-
# Organizational groups that you belong to (for People widget)
15+
# Organizational groups that you belong to (for People widget
1616
# Set this to `[]` or comment out if you are not using People widget.
1717
user_groups:
1818
- Alumni

Diff for: themes/wowchemy-hugo-modules/wowchemy/layouts/section/publication.html

+23-17
Original file line numberDiff line numberDiff line change
@@ -50,26 +50,32 @@
5050
</div>
5151

5252
<div id="container-publications">
53-
{{ range .Pages.ByDate.Reverse }}
53+
{{ $grouped_by_year := .Pages.GroupByDate "2006" }}
54+
{{ range $grouped_by_year }}
55+
{{ $year := .Key }}
56+
<div class="grid-sizer col-lg-12 isotope-item">
57+
<h2 style="font-weight: 600">{{ $year }}</h2>
58+
</div>
59+
{{ range .Pages }}
60+
{{ if .Params.publication_types }}
61+
{{ $.Scratch.Set "pubtype" (index .Params.publication_types 0) }}
62+
{{ else }}
63+
{{ $.Scratch.Set "pubtype" 0 }}
64+
{{ end }}
5465

55-
{{ if .Params.publication_types }}
56-
{{ $.Scratch.Set "pubtype" (index .Params.publication_types 0) }}
57-
{{ else }}
58-
{{ $.Scratch.Set "pubtype" 0 }}
59-
{{ end }}
66+
<div class="grid-sizer col-lg-12 isotope-item pubtype-{{ $.Scratch.Get "pubtype" }} year-{{ .Date.Format "2006" }}">
6067

61-
<div class="grid-sizer col-lg-12 isotope-item pubtype-{{ $.Scratch.Get "pubtype" }} year-{{ .Date.Format "2006" }}">
62-
{{ if eq $.Params.view 1 }}
63-
{{ partial "li_list" . }}
64-
{{ else if eq $.Params.view 3 }}
65-
{{ partial "li_card" . }}
66-
{{ else if eq $.Params.view 4 }}
67-
{{ partial "li_citation" . }}
68-
{{ else }}
69-
{{ partial "li_compact" . }}
68+
{{ if eq $.Params.view 1 }}
69+
{{ partial "li_list" . }}
70+
{{ else if eq $.Params.view 3 }}
71+
{{ partial "li_card" . }}
72+
{{ else if eq $.Params.view 4 }}
73+
{{ partial "li_citation" . }}
74+
{{ else }}
75+
{{ partial "li_compact" . }}
76+
{{ end }}
77+
</div>
7078
{{ end }}
71-
</div>
72-
7379
{{ end }}
7480
</div>
7581

0 commit comments

Comments
 (0)