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

recent_articles.html « widgets « partials « layouts - gitlab.com/toryanderson/hugo-icarus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d2f2891d12394b212da92fc326506af54558d950 (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
38
39
40
{{ if .Site.Params.widgets.recent_articles }}
<div class="widget-wrap">
    <h3 class="widget-title">
        {{with .Site.Data.l10n.widgets.recent_articles.title}}{{.}}{{end}}
    </h3>
    <div class="widget">
      <ul id="recent-post">
            {{ range last 5 .Site.RegularPages.ByPublishDate }}
            <li>
                <div class="item-thumbnail">
                    <a href="{{ .Permalink }}" class="thumbnail">
                    {{ if and (isset .Params "banner") (not (eq .Params.banner "")) }}
                        <span style="background-image:url({{ .Params.banner | absURL }})" alt="{{ $.Title }}" class="thumbnail-image"></span>
                    {{else}}
                        <span class="thumbnail-image thumbnail-none"></span>
                    {{ end }}
                    </a>
                </div>
                <div class="item-inner">
                    {{ if isset .Params "categories" }}
                    {{ if gt (len .Params.categories) 0 }}
                    <p class="item-category">
                        {{ $url := printf "%s/%s" "categories" (index .Params.categories 0 | urlize | lower)}}
                        <a class="article-category-link" href="{{ $url | absURL }}">
                        {{ index .Params.categories 0 }}
                        </a>
                    </p>
                    {{ end }}
                    {{ end }}
                    <p class="item-title"><a href="{{ .Permalink }}" class="title">{{ .Title }}</a></p>
                    <p class="item-date">
                        <time datetime="{{ .Date }}" itemprop="datePublished">{{ .Date.Format .Site.Params.date_format }}</time>
                    </p>
                </div>
            </li>
            {{ end }}
        </ul>
    </div>
</div>
{{ end }}