writing: new partial to filter essays by year

This commit is contained in:
desmukh 2022-12-27 12:01:50 +05:00
parent 4f78613498
commit 5207ecca45
2 changed files with 18 additions and 5 deletions

View File

@ -0,0 +1,6 @@
<h2>{{ .year }}</h2>
{{ range where .essays "year" .year }}
<div class="writing-item">
<p>{{ .year }}. <a href={{ .url }}><strong>{{ .title }}</strong></a>, <em>{{ .publication }}</em>, {{ .date }}.</p>
</div>
{{ end }}

View File

@ -2,12 +2,19 @@
<div id="content" class="section writing"> <div id="content" class="section writing">
<div> <div>
<div class="writing-section"> <div class="writing-section">
<div class="thead">ESSAYS</div> <div class="columns">
{{ range .Params.Essays }} <div class="column is-one-fifth" >
<div class="writing-item"> <div class="thead">ESSAYS</div>
<p>{{ .year }}. <a href={{ .url }}><strong>{{ .title }}</strong></a>, <em>{{ .publication }}</em>, {{ .date }}.</p>
</div> </div>
{{ end }} <div class="column">
{{ partial "essay-accordion" (dict "essays" .Params.Essays "year" 2022)}}
{{ partial "essay-accordion" (dict "essays" .Params.Essays "year" 2021)}}
{{ partial "essay-accordion" (dict "essays" .Params.Essays "year" 2020)}}
{{ partial "essay-accordion" (dict "essays" .Params.Essays "year" 2019)}}
{{ partial "essay-accordion" (dict "essays" .Params.Essays "year" 2018)}}
{{ partial "essay-accordion" (dict "essays" .Params.Essays "year" 2017)}}
</div>
</div>
</div> </div>
<div class="flex-row-books"> <div class="flex-row-books">
<div class="thead">BOOKS</div> <div class="thead">BOOKS</div>