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

single.html « posts « layouts - github.com/uPagge/uBlogger.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1e901769a96e92a58c3fc4574706b672de580f8e (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
{{- define "title" }}{{ .Title }} | {{ .Site.Title }}{{ end -}}

{{- define "content" -}}
    {{- $scratch := .Scratch.Get "scratch" -}}
    <article class="page single">
        {{- /* Title */ -}}
        <h1 class="single-title animated flipInX">{{ .Title }}</h1>

        {{- /* Meta */ -}}
        <div class="post-meta">
            <div class="post-meta-line">
                {{- $author := .Params.author | default .Site.Author.name | default (T "author") -}}
                {{- $authorLink := .Params.authorLink | default .Site.Author.link | default (relLangURL "/") -}}
                <span class="post-author">
                    {{- $link := dict "class" "author" "href" $authorLink "title" "Author" "rel" "author" "icon" (dict "class" "fas fa-user-circle fa-fw") "content" $author -}}
                    {{- partial "plugin/link.html" $link -}}
                </span>

                {{- with .Params.categories -}}
                    &nbsp;
                    <span class="post-category">
                        {{- T "included" -}}
                        {{- range $index, $value := . -}}
                            {{- if gt $index 0 }}&nbsp;{{ end -}}
                            <a href="{{ `/categories/` | relLangURL }}{{ urlize $value }}">
                                <i class="far fa-folder fa-fw"></i>{{ $value | humanize }}
                            </a>
                        {{- end -}}
                    </span>
                {{- end -}}
            </div>
            <div class="post-meta-line">
                {{- $publish_date := .PublishDate.Format (.Site.Params.dateFormatToUse | default "2006-01-02") -}}
                <i class="far fa-calendar-alt fa-fw"></i><time datetime={{ $publish_date }}>{{ $publish_date }}</time>&nbsp;
                <i class="fas fa-pencil-alt fa-fw"></i>{{ T "wordCount" .WordCount }}&nbsp;
                <i class="far fa-clock fa-fw"></i>{{ T "readingTime" .ReadingTime }}&nbsp;
                {{- if $scratch.Get "production" | and .Site.Params.comment.valine.enable | and .Site.Params.comment.valine.visitor -}}
                    <span id="{{ .RelPermalink | relURL }}" class="leancloud_visitors" data-flag-title="{{ .Title }}">
                        <i class="far fa-eye fa-fw"></i><span class=leancloud-visitors-count></span>&nbsp;{{ T "views" }}
                    </span>&nbsp;
                {{- end -}}
            </div>
        </div>

        {{- /* Featured image */ -}}
        {{- with .Params.featuredImage -}}
            <div class="featured-image">
                {{- partial "plugin/image.html" (dict "src" . "description" $.Description "scratch" $scratch) -}}
            </div>
        {{- end -}}

        {{- /* TOC */ -}}
        {{- if or .Params.toc (and .Site.Params.toc (ne .Params.toc false)) -}}
            <div class="toc" id="toc-auto">
                <h2 class="toc-title">{{ T "contents" }}</h2>
                {{- $globalAutoCollapseToc := .Site.Params.autoCollapseToc | default true }}
                <div class="toc-content{{ if not (and $globalAutoCollapseToc (ne .Params.autoCollapseToc false)) }} always-active{{ end }}" id="toc-content-auto"></div>
            </div>
            <div class="toc" id="toc-static">
                <details>
                    <summary>
                        <div class="toc-title">
                            <span>{{ T "contents" }}</span>
                            <span><i class="details icon fas fa-angle-down"></i></span>
                        </div>
                    </summary>
                    <div class="toc-content" id="toc-content-static">
                        {{- $toc := .TableOfContents -}}
                        {{- $toc = partial "function/fontawesome.html" $toc -}}
                        {{- $toc = partial "function/ruby.html" $toc -}}
                        {{- $toc | safeHTML -}}
                    </div>
                </details>
            </div>
        {{- end -}}

        {{- /* Content */ -}}
        <div class="content" id="content">
            {{- partial "single/content.html" .Content -}}
        </div>

        {{- /* Footer */ -}}
        {{- partial "single/footer.html" . -}}

        {{- /* Comment */ -}}
        {{- if ( .Params.comment | default true ) -}}
            {{- partial "comment.html" . -}}
        {{- end -}}
    </article>
{{- end -}}