blog/layouts/index.html

31 lines
849 B
HTML

{{ partial "default_head.html" . }}
<!-- Space delimited list of page types -->
{{ $paginator := .Paginate (where .Data.Pages "Type" "in" "post") }}
<div class="posts">
{{ range .Paginator.Pages }}
<div class="post">
<h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
<span class="post-date">{{ .Date.Format .Site.Params.DateForm }}</span>
{{ .Content }}
</div>
{{ end }}
</div>
<div class="pagination">
{{ if $paginator.HasNext }}
<a class="pagination-item older" href="{{ $paginator.Next.URL }}">Older</a>
{{ else }}
<span class="pagination-item older">Older</span>
{{ end }}
{{ if $paginator.HasPrev }}
<a class="pagination-item newer" href="{{ $paginator.Prev.URL }}">Newer</a>
{{ else }}
<span class="pagination-item newer">Newer</span>
{{ end }}
</div>
{{ partial "default_foot.html" . }}