squirrel/layouts/posts/single.html

91 lines
No EOL
4 KiB
HTML

{{ define "opengraph" }}
<meta name="twitter:card" content="summary_large_image" />
<meta property="og:type" content="article" />
{{ with .Site.LanguageCode }}
<meta property="og:locale" content='{{ replace . "-" "_" }}' />
{{ end }}
<meta property="og:title" content="{{ if .Title }}{{ .Title }}{{ else }}{{ .Site.Title }}{{ end }}" />
<meta name="twitter:title" content="{{ if .Title }}{{ .Title }}{{ else }}{{ .Site.Title }}{{ end }}" />
<meta property="og:url" content="{{ .Permalink }}" />
<meta property="og:site_name" content="{{ .Site.Title }}" />
{{ if .Params.image }}
<meta property="og:image" content="{{ .Params.image | absURL }}" />
<meta name="twitter:image" content="{{ .Params.image | absURL }}" />
{{ else }}
<meta property="og:image" content="{{ .Site.Params.logo | absURL }}" />
<meta name="twitter:image" content="{{ .Site.Params.logo | absURL }}" />
{{ end }}
{{ if .Params.summary }}
<meta property="og:description" content="{{ .Params.summary }}" />
<meta name="twitter:description" content="{{ .Params.summary }}" />
{{ else if .Content }}
<meta property="og:description" content="{{ .Content | safeHTML | truncate 100 }}" />
<meta name="twitter:description" content="{{ .Params.summary }}" />
{{ else }}
<meta property="og:description" content="{{ .Site.Params.Description }}" />
<meta name="twitter:description" content="{{ .Params.summary }}" />
{{ end }}
<meta property="article:published_time" content='{{.Date.Format "2006-01-02"}}' />
{{ with .Params.author }}
<meta property="article:author" content="{{ . }}" />
{{ end }}
<meta property="article:section" content="Blog" />
{{ with .Params.tags }}
{{ range . }}
<meta property="article:tag" content="{{ . }}" />
{{ end }}
{{ end }}
{{ end }}
{{ define "main" }}
{{ with .Params.image }}
<img class="coverimage {{ if eq .cover false }} noCover {{ end }}" alt="{{ .alt }}" src="{{ .url }}" />
{{ 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 }}
<img class="avatar-small" src="{{ .Params.image }}" alt="{{ .Params.name }} Avatar">
{{ else }}
<img class="avatar-small" src="{{ $.Site.Params.defaultimage }}" alt="Default Avatar">
{{ end }}
<h4 class="author-title">{{ .Params.name }}</h4>
<div class="social-media">
<span>
{{- range .Params.social}}
<a href="{{ .url }}"><i class="icon-{{ .type }}"></i></a>
{{- end}}
{{if .Params.mail}}
<a href="mailto:{{ .Params.mail }}"><i class="icon-at"></i></a>
{{end}}
</span>
</div>
</div>
</a>
{{end}}
{{ end }}
{{ end }}
</div>
{{ end }}