aboutsummaryrefslogtreecommitdiff
path: root/themes/hugo-theme-stack/layouts/partials/article/components/links.html
blob: a2ac26cab1e0c445a57d7a7a3620c279338a9a3b (plain) (blame)
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
<div class="article-list--compact links">
    {{ range $i, $link := .Params.links }}
        <article>
            <a href="{{ $link.website }}" target="_blank" rel="noopener">
                <div class="article-details">
                    <h2 class="article-title">
                        {{- $link.title -}}
                    </h2>
                    <footer class="article-time">
                        {{ with $link.description }}
                            {{ . }}
                        {{ else }}
                            {{ $link.website }}
                        {{ end }}
                    </footer>
                </div>
        
                {{ with $link.image }}
                    {{ $permalink := . }}
                    {{ with ($.Resources.GetMatch (printf "%s" (. | safeURL))) }}
                        {{ $permalink = .RelPermalink }}
                    {{ end }}
                    <div class="article-image">
                        <img src="{{ $permalink }}" loading="lazy">
                    </div>
                {{ end }}
            </a>
        </article>
    {{ end }}
</div>