Welcome to mirror list, hosted at ThFree Co, Russian Federation.

card.html « _default « layouts - github.com/puresyntax71/hugo-theme-chunky-poster.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 191e15b70003f14b3ada4fba27dfeea0a816a71e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<div class="card h-100">
    {{ $page := . }}
    <a href="{{ $page.RelPermalink }}" class="d-block">
        {{- with $page.Params.images -}}
            {{- $images := . -}}
            {{- with $page.Site.GetPage "section" "images" -}}
                {{- with .Resources.GetMatch (strings.TrimPrefix "/images/" (index $images 0)) -}}
                    {{- $image := .Resize "700x350" -}}
                    <img data-src="{{ $image.RelPermalink }}" class="card-img-top mx-auto d-block" alt="{{ $page.Title }}">
                {{- end -}}
            {{- end -}}
        {{- end -}}
        <div class="card-body">
            <h4 class="card-title">{{ $page.Title }}</h4>
            <p class="card-text text-muted text-uppercase">{{ $page.Date.Format "January 2, 2006" }}</p>
            <div class="card-text">
                {{ $page.Summary | plainify }}
            </div>
        </div>
    </a>
</div>