{{ define "main" }}
{{ if isset .Data "Term" }}
<h1>Posts tagged - "{{ .Data.Term }}"</h1>
<div class="meta">Here you'll find all posts tagged with "{{ .Data.Term }}"</div>
{{ else }}
<h1 class="page-title">All posts</h1>
<div class="meta"><a style="font-size: 1rem;" href="/index.xml" title="Subscribe to all posts">[<i data-feather="rss"></i>Subscribe]</a>
<a style="font-size: 1rem;" href="/tags" title="View all tags">[<i data-feather="tag"></i>Tags]</a></div>
{{ end }}

<ul class="posts">
	{{- range .Data.Pages -}}
		{{- if (not (in (.Site.Params.excludedTypes | default (slice "page")) .Type)) -}}
		<li class="post">
			<a href="{{ .RelPermalink }}">{{.Title}}</a> <span class="meta">{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</span>
		</li>
		{{- end -}}
	{{- end -}}
</ul>
{{ end }}
