@@ -11,26 +11,43 @@ <h1 class="post-title">{{ page.title | escape }}</h1>
1111 < div class ="post-content ">
1212 < div class ="description "> {{ content }}</ div > {% unless site.partial_build %}
1313 < div class ="content ">
14- < h2 > Selected Works < small > (in chronological order)</ small > </ h2 >
15- {% capture filter %}c.authors contains '{{ page.slug }}'{% endcapture %}
14+ {% capture filter %}c.authors contains '{{ page.slug }}'{% endcapture %}
1615 {% assign contents = site.content | where_exp: "c", filter %}
1716 {% capture filter %}c.translator contains " and {{page.slug}}" or c.translator contains "{{page.slug}} and " or c.translator == "{{page.slug}}"{% endcapture %}
18- {% assign transcont = site.content | where_exp: "c", filter %}
17+ {% assign transcont = site.content | where_exp: "c", filter | where_exp: "c", "c.status != 'rejected'" | sort: "slug" %}
1918 {% capture filter %}c.editor contains " and {{page.slug}}" or c.editor contains "{{page.slug}} and " or c.editor == "{{page.slug}}"{% endcapture %}
2019 {% assign editcont = site.content | where_exp: "c", filter %}
2120 {% assign readcont = site.content | where: "reader", page.slug %}
22- < div > {% include content_list.html contents=contents orderby="year" %}</ div >
23- {% if readcont.size > 0 %}
24- < h3 id ="readings "> Readings:</ h3 >
25- < div > {% include content_list.html contents=readcont orderby="year" %}</ div >
26- {% endif %}
27- {% if editcont.size > 0 %}
28- < h3 id ="edits "> Edited:</ h3 >
29- < div > {% include content_list.html contents=editcont orderby="year" %}</ div >
30- {% endif %}
21+
22+ {%- assign contents = contents | concat: editcont | concat: readcont | where_exp: "c", "c.status != 'rejected'" -%}
23+ {%- assign editcont = editcont | map: "url" -%}
24+ {%- assign c_by_year = contents | group_by: "year" | sort: "name" -%}
25+ < h2 > Selected Works by year</ h2 >
26+ < div >
27+ < p > {%- for year in c_by_year -%}< a href ="#{{year.name}} "> {{year.name}}</ a > {% unless forloop.last %} • {% endunless %}{%- endfor -%}</ p >
28+ {%- if transcont.size > 0 -%}
29+ < p > < a href ="#translations "> Click here</ a > to see {{ page.title }}'s translations.</ p >
30+ {%- endif -%}
31+ {%- for year in c_by_year -%}
32+ < h3 id ="{{year.name}} "> {{year.name}}</ h3 >
33+ {%- assign year_items = year.items | sort: 'title' -%}
34+ < div class ="minimal_content_list ">
35+ {% for c in year_items %}< div class ="mb-3 inline_content ">
36+ {% case c.stars %}{% when 5 %}< i class ="fas fa-medal "> </ i > {% when 4 %}< i class ="fas fa-star "> </ i > {% endcase %}{%- include_cached content_icon.html category=c.category subcat=c.subcat -%}
37+ < a href ="{{c.url}} "> {{ c.title | markdownify | remove: '< p > ' | remove: '</ p > ' }}</ a >
38+ {%- if editcont contains c.url -%}(edited){%- endif -%}
39+ </ div > {% endfor %}
40+ </ div >
41+ {%- endfor -%}
42+ </ div >
3143 {% if transcont.size > 0 %}
3244 < h3 id ="translations "> Translations by {{ page.title }}:</ h3 >
33- < div > {% include content_list.html contents=transcont orderby="slug" %}</ div >
45+ < div class ="minimal_content_list ">
46+ {% for c in transcont %}< div class ="mb-3 inline_content ">
47+ {% case c.stars %}{% when 5 %}< i class ="fas fa-medal "> </ i > {% when 4 %}< i class ="fas fa-star "> </ i > {% endcase %}{%- include_cached content_icon.html category=c.category subcat=c.subcat -%}
48+ < a href ="{{c.url}} "> {{ c.title | markdownify | remove: '< p > ' | remove: '</ p > ' }}</ a >
49+ </ div > {% endfor %}
50+ </ div >
3451 {% endif %}
3552 </ div > {% endunless %}
3653 </ div >
0 commit comments