erynwells.me/layouts/partials/single_main.html

51 lines
1.6 KiB
HTML

<article class="post-single">
<header>
{{ partial "development/draft_tag.html" . }}
<div class="post-title">
<h1>{{ .Title }}</h1>
{{ if not (eq .Type "page") }}
<div class="post-date"><time>{{ .Date | time.Format "January 2, 2006" }}</time></div>
{{ end }}
</div>
</header>
<section class="post-content">
{{ .Content }}
</section>
<footer>
{{- if or .Params.categories .Params.tags -}}
<ul class="tags">
{{- if .Params.categories -}}
{{- $categories := .GetTerms "categories" -}}
{{- if gt (len $categories) 1 -}}
{{- errorf "More than one category for %q" .Path -}}
{{- end -}}
{{- with index (.GetTerms "categories") 0 -}}
<li class="category"><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
{{- end -}}
{{- end -}}
{{- if and .Params.categories .Params.tags -}}
<li class="chevron noselect"></li>
{{- end -}}
{{- if .Params.tags -}}
{{- range .GetTerms "tags" -}}
<li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
{{- end -}}
{{- end -}}
</ul>
{{- end -}}
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
{{ if and (gt (len $pages) 1) (in $pages . ) }}
<nav class="post-nav">
{{ with $pages.Prev . }}
<a class="prev" href="{{ .Permalink }}"><span></span><span>{{ .Name }}</span></a>
{{ end }}
{{ with $pages.Next . }}
<a class="next" href="{{ .Permalink }}"><span>{{ .Name }}</span><span></span></a>
{{ end }}
</nav>
{{ end }}
</footer>
</article>