CHANGE image handling, ADD partials to reuse structure, REFACTOR
This commit is contained in:
parent
1265491dee
commit
01dcf04b8a
36 changed files with 1181 additions and 864 deletions
|
@ -1,47 +1,7 @@
|
|||
{{ 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 }}" />
|
||||
{{ $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 }}
|
||||
|
@ -67,18 +27,18 @@
|
|||
<a href="{{.Permalink}}">
|
||||
<div class="author">
|
||||
{{ if .Params.image }}
|
||||
<img class="avatar-small" src="{{ .Params.image }}" alt="{{ .Params.name }} Avatar">
|
||||
{{- partial "components/image.html" (dict "style" "avatar-small" "url" .Params.image "alt" .Params.name) -}}
|
||||
{{ else }}
|
||||
<img class="avatar-small" src="{{ $.Site.Params.defaultimage }}" alt="Default Avatar">
|
||||
{{- 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}}
|
||||
<a href="{{ .url }}"><i class="icon-{{ .type }}"></i></a>
|
||||
{{ partial "components/icon.html" . }}
|
||||
{{- end}}
|
||||
{{if .Params.mail}}
|
||||
<a href="mailto:{{ .Params.mail }}"><i class="icon-at"></i></a>
|
||||
{{ partial "components/icon.html" (dict "type" "at" "url" "mailto:{{ .Params.mail }}") }}
|
||||
{{end}}
|
||||
</span>
|
||||
</div>
|
||||
|
@ -88,4 +48,4 @@
|
|||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue