squirrel/layouts/posts/single.html

80 lines
3.3 KiB
HTML
Raw Normal View History

2022-07-01 11:39:37 +00:00
{{ define "opengraph" }}
<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 property="og:url" content="{{ .Permalink }}" />
<meta property="og:site_name" content="{{ .Site.Title }}" />
{{ if .Params.image }}
<meta property="og:image" content="{{ .Params.image | absURL }}" />
{{ else }}
<meta property="og:image" content="{{ .Site.Params.logo | absURL }}" />
{{ end }}
{{ if .Params.summary }}
<meta property="og:description" content="{{ .Params.summary }}" />
{{ else if .Content }}
<meta property="og:description" content="{{ .Content | safeHTML | truncate 100 }}" />
{{ else }}
<meta property="og:description" content="{{ .Site.Params.Description }}" />
{{ 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 }}
2022-07-01 12:33:34 +00:00
<meta property="twitter:card" content="summary_large_image" />
2022-07-01 11:39:37 +00:00
{{ end }}
2022-06-27 14:09:44 +00:00
{{ define "main" }}
{{ with .Params.image }}
<img class="coverimage" src="{{ . }}" />
{{ 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="Avatar">
{{ else }}
<img class="avatar-small" src="{{ $.Site.Params.defaultimage }}" alt="Avatar">
{{ end }}
<h4 class="author-title">{{ .Params.name }}</h4>
<div class="social-media">
<span>
{{- range .Params.social}}
<a href="{{ .url }}"><i class="fab fa-{{ .type }}"></i></a>
{{- end}}
{{if .Params.mail}}
<a href="mailto:{{ .Params.mail }}"><i class="fas fa-at"></i></a>
{{end}}
</span>
</div>
</div>
</a>
{{end}}
{{ end }}
{{ end }}
</div>
{{ end }}