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

details.html « components « article « partials « layouts - github.com/CaiJimmy/hugo-theme-stack.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9c2517d9bcd6c59f3edd291e262ec3bc21275f4e (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
{{ $i := .Params.image }}
{{ $context := . }}

<div class="article-details">
    {{ with $categories := .Params.categories }}
    <header class="article-category">
        {{ range $categories }}
            {{ if $i }}
                {{- $image := partial "helper/image" $context | resources.Fingerprint "md5"  -}}
                {{- $20x := $image.Fill "20x20 smart"  -}}
                <a href="/categories/{{ . | urlize }}" class="color-tag"
                    data-image="{{ $20x.RelPermalink }}" data-key="{{ $context.Slug }}" data-hash="{{ $image.Data.Integrity }}">{{ . | humanize }}</a>
            {{ else }}
                <a href="/categories/{{ . | urlize }}">{{ . | humanize }}</a>
            {{ end }}
        {{ end }}
    </header>
    {{ end }}

    <h2 class="article-title">
        <a href="{{ .Permalink }}">
            {{- .Title -}}
        </a>
    </h2>

    {{ with .Params.description }}
    <h3 class="article-subtitle">
        {{ . }}
    </h3>
    {{ end }}

    {{- if not .Date.IsZero -}}
    <footer class="article-time">
        {{ (resources.Get "icons/clock.svg").Content | safeHTML }}
        <time class="article-time--published">
            {{- .Date.Format ( or .Site.Params.dateFormat "Jan 02, 2006" ) -}}
        </time>
    </footer>
    {{- end -}}
</div>