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

card.html « post « partials « layouts - github.com/mmrath/hugo-bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 069d2f23c8bfd0dff47398e90028647357048da5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<div class="col-xs-12 col-md-6 col-lg-4 pb-3 px-2 align-self-stretch d-flex align-items-stretch">
    <div class="card mx-0 post-card">

      {{ if and (isset .Params "thumbnail") (not (eq .Params.thumbnail "")) }}
        <a href="{{ .Permalink }}" itemprop="url">
            {{if or (in (substr .Params.thumbnail 0 7) "http://") (in (substr .Params.thumbnail 0 8) "https://")}}
              <img src="{{ .Params.thumbnail }}" class="card-img-top">
            {{ else if  (in (substr .Params.thumbnail 0 1) "/" ) }}
              <img src="{{ .Params.thumbnail | relURL }}" class="card-img-top">
            {{ else }}
              <img src="{{ .Permalink }}{{ .Params.thumbnail }}" class="card-img-top">
            {{end}}
        </a>
        {{ end }}

    <div class="card-body">
      <p class="card-title">
          <a href="{{ .Permalink }}">{{ if .IsPage }}{{ if .Draft }}{{ .Site.Data.Strings.draft }} :: {{ end }}{{ end }}{{ .Title }}</a>
      </p>
      <p class="card-text">
          {{ if .IsPage }}
          {{ if .Description }}
            {{ .Description | markdownify | truncate 140 }}
          {{ else }}
            {{ .Summary | truncate 140}}
          {{ end }}
        {{ end }}
      </h4>
    </div>
    <div class="card-footer recentpost">
        <small class="text-muted">
            <time datetime="{{ .Date.Format "22 July 2017" }}">{{ .Date.Format .Site.Data.Formats.date }}</time>
          &middot;&nbsp;{{ .ReadingTime }} {{ .Site.Data.Strings.metaReadinMinutes }}
        </small>
    </div>  
  </div>
</div>