mirror of
https://git.adityakumar.xyz/hugo-theme-introduction.git
synced 2024-12-22 22:52:54 +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,18 +1,19 @@
|
||||||
<section>
|
<section>
|
||||||
{{ $prev := 2100}} <!--start at year 2100-->
|
{{ $prev := now.Format "2006"}} <!--start from the current year-->
|
||||||
{{range .Pages.ByPublishDate.Reverse}}
|
<h2 class="title is-2 top-pad">{{ $prev }}</h2>
|
||||||
{{if .Date}}
|
{{range .Pages.ByPublishDate.Reverse}}
|
||||||
{{$curr := .Date.Format "2006"}}
|
{{if .Date}}
|
||||||
{{if gt $prev ($curr)}}
|
{{$curr := .Date.Format "2006"}}
|
||||||
<h2 class="title is-2 top-pad">{{ $curr }}</h2>
|
{{if lt $curr $prev }}
|
||||||
{{end}}
|
<h2 class="title is-2 top-pad">{{ $curr }}</h2>
|
||||||
<li class="post-item">
|
|
||||||
{{ if .Params.date }}
|
|
||||||
<span>{{ .Date.Format (.Site.Params.dateFormat | default "Jan 02, 2006") }}</span> -
|
|
||||||
{{ end }}
|
|
||||||
<span><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></span>
|
|
||||||
</li>
|
|
||||||
{{ $prev = $curr}}
|
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
<li class="post-item">
|
||||||
|
{{ if .Params.date }}
|
||||||
|
<span>{{ .Date.Format (.Site.Params.dateFormat | default "Jan 02, 2006") }}</span> -
|
||||||
|
{{ end }}
|
||||||
|
<span><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></span>
|
||||||
|
</li>
|
||||||
|
{{ $prev = $curr}}
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
</section>
|
</section>
|
||||||
|
|
Loading…
Reference in a new issue