91 lines
3 KiB
HTML
91 lines
3 KiB
HTML
<div class="col-md-4 mt20">
|
|
|
|
{{ if .Params.img -}}
|
|
<img width="100%" class="mt-3"
|
|
src="{{ .Site.BaseURL}}img/{{ .Params.img }}" alt="{{ .Params.title }}">
|
|
{{- else if .Params.teaser -}}
|
|
<div class="card mt-3">
|
|
<div class="card-body bg-light">
|
|
<h5 class="card-text">{{ .Params.teaser }}</h5>
|
|
</div>
|
|
</div>
|
|
{{- else if .Site.Params.defaultImage -}}
|
|
<img width="100%" class="mt-3"
|
|
src="{{ .Site.BaseURL }}img/{{ .Site.Params.defaultImage }}" alt="dummy">
|
|
{{- else if .Params.Summary -}}
|
|
<div class="card mt-3">
|
|
<div class="card-body bg-light">
|
|
<h5 class="card-text">{{ .Params.Summary }}</h5>
|
|
</div>
|
|
</div>
|
|
{{- end }}
|
|
|
|
{{- $site := .Site -}}
|
|
{{ with .Params.Topics -}}
|
|
<div class="card mt-3">
|
|
<div class="card-header">
|
|
<h4 class="card-text">{{i18n "topics"}}</h4>
|
|
</div>
|
|
<div class="card-body">
|
|
{{ range . -}}
|
|
{{- $page := $site.GetPage (printf "/topics/%s" .) -}}
|
|
<span class="badge rounded-pill bg-secondary m-1">
|
|
<a href="{{ $page.Permalink }}">{{ $page.Title }}</a>
|
|
</span>
|
|
{{- end }}
|
|
</div>
|
|
</div>
|
|
{{- end }}
|
|
|
|
{{ if not .Site.Params.hideRelatedArticles -}}
|
|
{{- with .Params.Topics -}}
|
|
<div class="card mt-3">
|
|
<div class="card-header">
|
|
<h4 class="card-text">{{ i18n "related" }}</h4>
|
|
</div>
|
|
<div class="card-body">
|
|
<ul id="topics" class="list-inline">
|
|
{{ range (where $site.RegularPages "Params.topics" "intersect" .) }}
|
|
<li>
|
|
<a href="{{ .Permalink }}"
|
|
class="text-decoration-none">{{ .Title }}
|
|
{{ if .Date -}}
|
|
<small>{{ .Date.Format (i18n "dateFormat") }}</small>
|
|
{{- else if .Params.Teaser -}}<small>{{ .Params.Teaser }}</small>
|
|
{{- else -}}<small>{{ .Summary }}</small>
|
|
{{- end }}
|
|
</a>
|
|
</li>
|
|
{{ end }}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
{{- end -}}
|
|
{{- end }}
|
|
|
|
{{ if not .Site.Params.hideSectionArticles -}}
|
|
<div class="card mt-3">
|
|
{{- $section := or .Section "posts" -}}
|
|
<div class="card-header">
|
|
<h4 class="card-text">{{ or (i18n (printf "articles-in-%s" $section)) (i18n "articles-in-section") }}</h4>
|
|
</div>
|
|
<div class="card-body">
|
|
<ul class="list-inline">
|
|
{{ range first 20 (where .Site.RegularPages "Section" $section) }}
|
|
<li>
|
|
<a href="{{ .Permalink }}"
|
|
class="text-decoration-none">{{ .Title }}
|
|
{{ if .Date -}}
|
|
<small>{{ .Date.Format (i18n "dateFormat") }}</small>
|
|
{{- else if .Params.Teaser -}}<small>{{ .Params.Teaser }}</small>
|
|
{{- else -}}<small>{{ .Summary }}</small>
|
|
{{- end }}
|
|
</a>
|
|
</li>
|
|
{{ end }}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
{{- end }}
|
|
|
|
</div>
|