runtimeterror/layouts/partials/aside.html

56 lines
1.8 KiB
HTML

{{- $postDate := .Date.Format "2006-01-02" }}
{{- $updateDate := .Lastmod.Format "2006-01-02" }}
{{ if or (.Params.description) (.Params.date) }}
{{ if .Params.description }}<p>{{ .Params.description }}</p>{{ end }}
<p>
{{ if .Params.date }}<table><tr><td>posted:</td><td>{{ $postDate }}</td></tr>{{- if ne $postDate $updateDate }}<tr><td>updated:</td><td>{{ $updateDate }}</td></tr>{{ end }}</table>{{ end }}
</p>
<p>
{{ if and (gt .WordCount 400 ) (gt (len .TableOfContents) 180) }}
<h2>On this page</h2>
{{ .TableOfContents }}
<hr>
{{ end }}
{{- with .Params.tags -}}
<a href="/tags">tags</a>:<br>
{{- range . }}
{{- $tag := urlize . -}}
[<a href='{{ absLangURL (printf "tags/%s" $tag) }}' title="{{ . }}">{{ . }}</a>]
{{- end }}
<hr>
{{- end }}
</p>
{{ end }}
{{ if isset .Params "series" }}
{{$related := where .Site.RegularPages ".Params.series" "eq" .Params.series }}
{{- $relatedLimit := default 8 .Site.Params.numberOfRelatedPosts }}
<h2>More {{ .Params.series }}</h2>
<ul>
{{- range first $relatedLimit $related }}
<li>
<a href="{{ .Permalink }}" title="{{ .Title }}">{{ .Title | markdownify }}</a>
</li>
{{ end }}
{{ if gt (len $related) $relatedLimit }}
<li>
<a href="/series/{{ lower .Params.series }}/"><i>See all {{ .Params.series }}</i></a>
</li>
{{ end }}
</ul>
<hr>
{{ end }}
{{- $posts := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
{{- $featured := default 8 .Site.Params.numberOfFeaturedPosts }}
{{- $featuredPosts := first $featured (where $posts "Params.featured" true)}}
{{- with $featuredPosts }}
<h2>Featured Posts</h2>
<ul>
{{- range . }}
<li>
<a href="{{ .Permalink }}" title="{{ .Title }}">{{ .Title | markdownify }}</a>
</li>
{{- end }}
</ul>
{{- end }}