squirrel/layouts/posts/single.html

51 lines
2.2 KiB
HTML

{{ define "main" }}
{{ with .Params.image }}
{{ $style := "coverimage {{if ne .Params.image.cover }} noCover {{ end }}" }}
{{- partial "components/image.html" (dict "style" $style "url" .url "alt" .alt) -}}
{{ with .copyright }}
<div class="image-copyright">© {{ . }}</div>
{{ end }}
{{ end }}
<div class="content">
{{ with .Params.tags }}
<div id="tags">
{{ range . }}
<a href="{{ "tags" | absURL }}/{{ . | urlize }}/">#{{ . }}</a>
{{ end }}
</div>
{{ end }}
<div class="title">
<h1 class="content-title">{{ .Title }}</h1>
<div class="post-detail">{{.Date.Format "02.01.2006"}} - ⏱ {{.ReadingTime}} Minuten</div>
<div class="divider"></div>
</div>
{{ .Content }}
{{- $author := .Params.author }}
{{ with .Site.GetPage "/team" }}
{{- range .RegularPages -}}
{{if eq .Params.name $author}}
<a href="{{.Permalink}}">
<div class="author">
{{ if .Params.image }}
{{- partial "components/image.html" (dict "style" "avatar-small" "url" .Params.image "alt" .Params.name) -}}
{{ else }}
{{- partial "components/image.html" (dict "style" "avatar-small" "url" $.Site.Params.defaultimage "alt" "Placeholder") -}}
{{ end }}
<h4 class="author-title">{{ .Params.name }}</h4>
<div class="social-media">
<span>
{{- range .Params.social}}
{{ partial "components/icon.html" . }}
{{- end}}
{{if .Params.mail}}
{{ partial "components/icon.html" (dict "type" "at" "url" "mailto:{{ .Params.mail }}") }}
{{end}}
</span>
</div>
</div>
</a>
{{end}}
{{ end }}
{{ end }}
</div>
{{ end }}