card: missing image: show teaser if present
This commit is contained in:
parent
18553b7377
commit
d38d061885
4 changed files with 28 additions and 14 deletions
|
@ -32,6 +32,9 @@ prev:
|
||||||
recentArticles:
|
recentArticles:
|
||||||
other: Aktuelle Artikel
|
other: Aktuelle Artikel
|
||||||
|
|
||||||
|
Teaser:
|
||||||
|
other: Hintergrund
|
||||||
|
|
||||||
topics:
|
topics:
|
||||||
other: Themen
|
other: Themen
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,9 @@ prev:
|
||||||
recentArticles:
|
recentArticles:
|
||||||
other: Recent Posts
|
other: Recent Posts
|
||||||
|
|
||||||
|
Teaser:
|
||||||
|
other: Teaser
|
||||||
|
|
||||||
topics:
|
topics:
|
||||||
other: Topics
|
other: Topics
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,10 @@
|
||||||
{{ if .Params.img }}
|
{{ if .Params.img }}
|
||||||
<img width="100%"
|
<img width="100%"
|
||||||
src="{{ .Site.BaseURL }}img/{{ .Params.img }}" alt="{{ .Title }}">
|
src="{{ .Site.BaseURL }}img/{{ .Params.img }}" alt="{{ .Title }}">
|
||||||
|
{{ else if .Params.teaser }}
|
||||||
|
<div class="card-header">
|
||||||
|
<p class="card-text">{{ .Params.teaser }}</p>
|
||||||
|
</div>
|
||||||
{{ else if .Site.Params.defaultImage }}
|
{{ else if .Site.Params.defaultImage }}
|
||||||
<img width="100%"
|
<img width="100%"
|
||||||
src="{{ .Site.BaseURL }}img/{{ .Site.Params.defaultImage }}"
|
src="{{ .Site.BaseURL }}img/{{ .Site.Params.defaultImage }}"
|
||||||
|
@ -14,9 +18,6 @@
|
||||||
<span class="card-title h4">{{ .Title | truncate 25 }}</span>
|
<span class="card-title h4">{{ .Title | truncate 25 }}</span>
|
||||||
<span class="post-meta pull-right">
|
<span class="post-meta pull-right">
|
||||||
<small>{{ .Date.Format (i18n "dateFormat") }}</small></span>
|
<small>{{ .Date.Format (i18n "dateFormat") }}</small></span>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="card-body">
|
|
||||||
<p class="card-text">{{ .Summary | plainify | truncate 100 }}</p>
|
<p class="card-text">{{ .Summary | plainify | truncate 100 }}</p>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -1,18 +1,25 @@
|
||||||
<div class="col-md-4 mt20">
|
<div class="col-md-4 mt20">
|
||||||
|
|
||||||
<div class="card mt-3 mb-3">
|
{{ if .Params.img }}
|
||||||
{{ if .Params.img }}
|
<img width="100%" class="mt-3"
|
||||||
<img width="100%"
|
src="{{ .Site.BaseURL}}img/{{ .Params.img }}" alt="{{ .Params.title }}">
|
||||||
src="{{ .Site.BaseURL}}img/{{ .Params.img }}" alt="{{ .Params.title }}">
|
{{ else if .Params.teaser }}
|
||||||
{{ else }}
|
<div class="card mt-3">
|
||||||
<img width="100%"
|
<div class="card-header">
|
||||||
src="{{ .Site.BaseURL }}img/{{ .Site.Params.defaultImage }}" alt="dummy">
|
<p class="card-text">{{ i18n "Teaser" }}</p>
|
||||||
{{ end }}
|
</div>
|
||||||
</div>
|
<div class="card-body">
|
||||||
|
<p class="card-text">{{ .Params.teaser }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{ else if .Site.Params.defaultImage }}
|
||||||
|
<img width="100%" class="mt-3"
|
||||||
|
src="{{ .Site.BaseURL }}img/{{ .Site.Params.defaultImage }}" alt="dummy">
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{ $taxo := "topics" }}
|
{{ $taxo := "topics" }}
|
||||||
{{ if .Param $taxo }}
|
{{ if .Param $taxo }}
|
||||||
<div class="card mb-3">
|
<div class="card mt-3">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h4>{{i18n "topics"}}</h4>
|
<h4>{{i18n "topics"}}</h4>
|
||||||
</div>
|
</div>
|
||||||
|
@ -30,7 +37,7 @@
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<div class="card mb-3">
|
<div class="card mt-3">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h4>{{i18n "recentArticles"}}</h4>
|
<h4>{{i18n "recentArticles"}}</h4>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue