Skip to content

Instantly share code, notes, and snippets.

@jsonbecker
Created December 26, 2024 19:22
Show Gist options
  • Save jsonbecker/ede0a93d104f61be61e12a8713638ea8 to your computer and use it in GitHub Desktop.
Save jsonbecker/ede0a93d104f61be61e12a8713638ea8 to your computer and use it in GitHub Desktop.
{{ define "main" }}
<div class="content list h-feed singlearea">
{{$pages := where .Site.Pages "Type" "post" }}
{{ range $pages.GroupByDate "2006" }}
<div class="year">
<h2>{{ .Key }}</h2>
{{ range .Pages.GroupByDate "January" }}
<div class="month">
<h3>{{ .Key }}</h3>
<div class="post-list">
{{ range .Pages }}
{{ if .Title }}
<div class="post-item">
<div class="date">{{ .Date.Format "Jan 02" }}</div>
<a href="{{ .Permalink }}" class="u-url">
<div class="archive-title">{{ .Title }}</div>
</a>
</div>
{{ else }}
{{ end }}
{{ end }}
</div>
</div>
{{ end }}
</div>
{{ end }}
</div>
{{ end }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment