site/layouts/partials/posts.html

40 lines
1.1 KiB
HTML

{{ $outerRel := .RelPermalink -}}
{{ if in $outerRel "posts" -}}
{{ partial "anchor-heading.html" (dict "Text" "Posts" "Level" 1 "Anchor" "posts") }}
{{ .Content }}
{{ else -}}
{{ partial "anchor-heading.html" (dict "Text" "Posts" "Level" 2 "Anchor" "posts") }}
{{ (.Site.GetPage "posts").Content }}
{{- end }}
<p class="meta">
<a href="{{ .Site.BaseURL }}tags/">Tags</a> |
<a href="{{ .Site.BaseURL }}posts/index.xml">RSS feed</a> |
<a href="{{ .Site.BaseURL }}posts/atom.xml">Atom feed</a>
</p>
<ul class="post-list">
{{- range (where .Site.RegularPages "Section" "posts") }}
<li>
{{ if in $outerRel "posts" -}}
<h2>
{{ else -}}
<h3>
{{ end -}}
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
{{ if in $outerRel "posts" -}}
</h2>
{{ else -}}
</h3>
{{ end -}}
<p class="post-meta">
<time datetime="{{ .Date.Format "2006-01-02 15:04:05Z07:00" }}">{{ .Date.Format "Jan 02, 2006" }}</time>
&nbsp;·&nbsp; {{ partial "tags.html" . }}
</p>
<p class="desc">{{ .Description }}</p>
</li>
{{- end }}
</ul>