Merge pull request #50 from kranurag78/kranurag78-patch-1

feat: Year wise formatting of posts
This commit is contained in:
x 2023-03-15 22:25:29 +08:00 committed by GitHub
commit 7a140d4bba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,9 +6,14 @@
<h2 class="text-4xl mt-8 mb-8">{{ .Title }}</h2> <h2 class="text-4xl mt-8 mb-8">{{ .Title }}</h2>
{{ end }} {{ end }}
<div class="mt-8"> <div class="mt-8">
{{ range .Data.Pages }} {{ range .Data.Pages.GroupByDate "2006" }}
<h3 class="text-3xl font-bold mb-4 mt-8">
<a href="#{{ .Key }}">{{ .Key }}</a>
</h3>
{{ range .Pages }}
{{ partial "item.html" . }} {{ partial "item.html" . }}
{{ end }} {{ end }}
{{ end }}
</div> </div>
</main> </main>
{{ end }} {{ end }}