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

compact.html « article-list « partials « layouts - github.com/CaiJimmy/hugo-theme-stack.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1a71318db99bc7eb8d882f091a27575f6650933c (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
<article>
    <div class="article-details">
        <h2 class="article-title">
            <a href="{{ .Permalink }}">
                {{- .Title -}}
            </a>
        </h2>
        <footer class="article-time">
            <time datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}'>
                {{- .Date.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") -}}
            </time>
        </footer>
    </div>

    {{ $image := partial "helper/image" (dict "Context" . "Type" "articleList") }}
    
    {{ if $image.exists }}
        <div class="article-image">
            {{ if $image.resource }}
                {{- $thumbnail := $image.resource.Fill "120x120" -}}
                <img src="{{ $thumbnail.RelPermalink }}" width="{{ $thumbnail.Width }}"
                    height="{{ $thumbnail.Height }}" loading="lazy">
            {{ else }}
                <img src="{{ $image.permalink }}" loading="lazy" alt="Featured image of post {{ .Title }}" />
            {{ end }}
        </div>
    {{ end }}
</article>