diff options
author | Angelo <AIRyndon@users.noreply.github.com> | 2020-12-24 11:31:47 +0300 |
---|---|---|
committer | Angelo <AIRyndon@users.noreply.github.com> | 2020-12-24 11:31:47 +0300 |
commit | 630c4c6b48344901eef91d6153cba5cae5a2a15a (patch) | |
tree | 26cf835dc21011a9bd31ca29a22c5ecfff30e55d /layouts/partials/blog/archive.html | |
parent | 6925c0248cf70674576d42d173ff33b00a3d522a (diff) |
add archive format to all posts
Diffstat (limited to 'layouts/partials/blog/archive.html')
-rw-r--r-- | layouts/partials/blog/archive.html | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/layouts/partials/blog/archive.html b/layouts/partials/blog/archive.html new file mode 100644 index 0000000..eaba407 --- /dev/null +++ b/layouts/partials/blog/archive.html @@ -0,0 +1,18 @@ +<section> + {{ $prev := 2100}} <!--start at year 2100--> + {{range .Pages.ByPublishDate.Reverse}} + {{if .Date}} + {{$curr := .Date.Format "2006"}} + {{if gt $prev ($curr)}} + <h2 class="title is-2 top-pad">{{ $curr }}</h2> + {{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> |