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: 4b4c97d8fa07f604dd9c38031c001e197cd234b3 (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
{{ 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 first 5 (where .Site.Pages "Type" "post") }}
            <li>
                <div class="item-thumbnail">
                    <a href="{{ $.Permalink }}" class="thumbnail">
                    {{ if isset .Params "banner" }}
                        <span style="background-image:url({{ $.Site.BaseURL }}{{ .Params.banner }})" alt="{{ $.Title }}" class="thumbnail-image"></span>
                    {{else}}
                        <span class="thumbnail-image thumbnail-none"></span>
                    {{ end }}
                    </a>
                </div>
                <div class="item-inner">
                    {{ if ge (len .Params.categories ) 1 }}
                    <p class="item-category">
                        <a class="article-category-link" href="{{ $.Site.BaseURL }}categories/{{ index .Params.categories 0 | urlize | lower }}">
                        {{ index .Params.categories 0 }}
                        </a>
                    </p>
                    {{ 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 }}