mirror of
https://git.adityakumar.xyz/hugo-theme-introduction.git
synced 2024-11-14 00:59:43 +00:00
remove 2100 variable in the solution
This commit is contained in:
parent
630c4c6b48
commit
50d13c4e83
1 changed files with 16 additions and 15 deletions
|
@ -1,9 +1,10 @@
|
||||||
<section>
|
<section>
|
||||||
{{ $prev := 2100}} <!--start at year 2100-->
|
{{ $prev := now.Format "2006"}} <!--start from the current year-->
|
||||||
|
<h2 class="title is-2 top-pad">{{ $prev }}</h2>
|
||||||
{{range .Pages.ByPublishDate.Reverse}}
|
{{range .Pages.ByPublishDate.Reverse}}
|
||||||
{{if .Date}}
|
{{if .Date}}
|
||||||
{{$curr := .Date.Format "2006"}}
|
{{$curr := .Date.Format "2006"}}
|
||||||
{{if gt $prev ($curr)}}
|
{{if lt $curr $prev }}
|
||||||
<h2 class="title is-2 top-pad">{{ $curr }}</h2>
|
<h2 class="title is-2 top-pad">{{ $curr }}</h2>
|
||||||
{{end}}
|
{{end}}
|
||||||
<li class="post-item">
|
<li class="post-item">
|
||||||
|
|
Loading…
Reference in a new issue