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: 7459891e395e756e8773a641067590f334aeceb1 (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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
{{- define "title" }}{{ .Title }} | {{ .Site.Params.Title }}{{ end -}}

{{- define "no-content" -}}

{{- $params := .Scratch.Get "params" -}}

{{- $toc := $params.toc -}}
{{- if eq $toc true -}}
{{- $toc = .Site.Params.page.toc | default dict -}}
{{- else if eq $toc false -}}
{{- $toc = dict "enable" false -}}
{{- end -}}

{{- $pageTheme := $params.Theme | default .Site.Params.Page.theme | default "classic" -}}

<div class="container content-article {{ if eq $toc.keepStatic false }}page-toc{{ end }} theme-{{ $pageTheme }}">

    {{- /* Auto TOC */ -}}
    {{- if ne $toc.enable false -}}
        <div class="toc" id="toc-auto">
            <div class="toc-title">{{ T "contents" }}</div>
            <div class="toc-content{{ if eq $toc.auto false }} always-active{{ end }}" id="toc-content-auto"></div>
        </div>
    {{- end -}}


    {{- /* Featured image */ -}}
    {{- $image := $params.featuredimage -}}
    {{- $pageImageHidden := $params.hiddenFeaturedImage -}}
    {{- with .Resources.GetMatch "featured-image" -}}
    {{- $image = .RelPermalink -}}
    {{- end -}}


    <div class="header-post">
        {{ if or (eq $pageTheme "full") (eq $pageTheme "mega-full") }}
        {{- with $image -}}
    <div class="featured-image" style="background-image: url('{{ $image }}');">
        {{- end -}}
        {{- end -}}
        <div class="post-title">

            <div class="post-all-meta">
            {{ partial "breadcrumbs.html" . | safeHTML }}
            <h1 class="single-title animated flipInX">{{ $.Title }}</h1>
            {{- /* Subtitle */ -}}
            {{- with $params.subtitle -}}
            <h2 class="single-subtitle">{{ . }}</h2>
            {{- end -}}
            {{- /* Meta */ -}}
            <div class="post-meta">
                <div class="post-meta-line">
                    {{- $categories := slice -}}
                    {{- range $.Params.categories -}}
                    {{- $category := partialCached "function/path.html" . . | printf "/categories/%v" | $.Site.GetPage -}}
                    {{- $categories = $categories | append (printf `<a href="%v"><i class="far fa-folder fa-fw"></i>&nbsp;%v</a>` $category.RelPermalink $category.Title) -}}
                    {{- end -}}
                    {{- with delimit $categories "&nbsp;" -}}
                    <span class="post-category">
                                {{ . }}
                            </span>
                    {{- end -}}

                    {{- with $.Site.Params.dateformat | default "2006-01-02" | $.PublishDate.Format -}}
                    {{- $timeAgoDate:= $.Site.Params.TimeAgo.DateFormat | default "2006-01-02" | $.PublishDate.Format -}}
                    &nbsp;&nbsp;&nbsp;&nbsp;<i class="far fa-calendar-alt fa-fw"></i>&nbsp;<time class="timeago" datetime="{{ $timeAgoDate }}">{{ . }}</time>
                    {{- end -}}
                    &nbsp;&nbsp;&nbsp;&nbsp;<i class="fas fa-pencil-alt fa-fw"></i>&nbsp;{{ T "wordCount" $.WordCount }}
                    &nbsp;&nbsp;&nbsp;&nbsp;<i class="far fa-clock fa-fw"></i>&nbsp;{{ T "readingTime" $.ReadingTime }}
                    {{- $comment := $.Scratch.Get "comment" | default dict -}}
                    {{- if $comment.enable | and $comment.valine.enable | and $comment.valine.visitor -}}
                    <span id="{{ .RelPermalink }}" class="leancloud_visitors" data-flag-title="{{ .Title }}">
                        <i class="far fa-eye fa-fw"></i>&nbsp;<span class=leancloud-visitors-count></span>&nbsp;{{ T "views" }}
                    </span>&nbsp;
                    {{- end -}}
                </div>
            </div>
        </div>


    </div>

    </div>

        {{ if or (eq $pageTheme "full") (eq $pageTheme "mega-full") }}
        {{- with $image -}}
    </div>
            {{- end -}}
            {{- end -}}



    <article class="single toc-start">

        <div class="content-block content-block-first content-block-position">

        <div class="post">

            {{- if and (or (eq $pageTheme "classic") (eq $pageTheme "wide")) (not $pageImageHidden) -}}
            {{- with $image -}}
            <div class="image-theme-{{ $pageTheme }}">
                <img src="{{ $image }}" style="width: 100%">
            </div>
            {{- end -}}
            {{- end -}}

            {{- /* Static TOC */ -}}
            {{- if ne $toc.enable false -}}
            <div class="details toc" id="toc-static"  data-kept="{{ if $toc.keepStatic }}true{{ end }}">
                <div class="details-summary toc-title">
                    <span>{{ T "contents" }}</span>
                    <span><i class="details-icon fas fa-angle-right"></i></span>
                </div>
                <div class="details-content toc-content" id="toc-content-static">
                    {{- dict "Content" .TableOfContents "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}
                </div>
            </div>
            {{- end -}}

            {{- /* Content */ -}}

                {{- with .Site.Params.dateformat | default "2006-01-02" | .Lastmod.Format -}}
                {{- $updateDate := . -}}
                {{- if not (eq  . ($.Site.Params.dateformat | default "2006-01-02" | $.PublishDate.Format)) -}}
                {{- with $params.upd -}}
                <p class="is-style-explanation">
                    <b>{{- dict "Date" $updateDate | T "updatedOnDate" -}}:</b> {{ $params.upd }}
                </p>
                {{- else -}}
                <span class="post-update">
                    <b>{{- dict "Date" . | T "updatedOnDate" -}}</b>
                </span>
                {{- end -}}
                {{- end -}}
                {{- end -}}

                {{- dict "Content" .Content "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}

        </div>

            <div class="post">
                {{- /* Footer Post */ -}}
                {{- partial "single/footer.html" . -}}
            </div>
        </div>
    <div id="toc-final"></div>
    </article>

{{- with .Params.tags -}}
    <div class="{{ if $toc.keepStatic }} post-tags {{ else }} post-tags post-tags-toc {{ end }}">
            {{- range $index, $value := . -}}
                {{- $tag := partialCached "function/path.html" $value $value | printf "/tags/%v" | $.Site.GetPage -}}
                <a href="{{ $tag.RelPermalink }}" class="tag">{{ $tag.Title }}</a>
            {{- end -}}
    </div>
{{- end -}}

    {{- $comment := .Site.Params.Comment -}}
    {{- if $comment.enable -}}
    <div class="page single comments content-block-position">
        {{- $authorComment := $params.authorComment -}}
        {{- $authorName := $params.author | default .Site.Author.name | default " " -}}
        {{- if not (eq $authorName " ") -}}
        {{ $author := index .Site.Data.authors $authorName }}
        {{- if $authorComment -}}
        <div class="author-comment">
            <div class="author-avatar" style="float: left"><a href="{{ with $author.site }} {{- . | safeHTML -}}{{ end }}" target="_blank"><img alt="" src="{{ with $author.avatar }} {{- . | safeHTML -}}{{ end }}" border="0"></a></div>
            <div class="name">{{ $author.name }}</div>
            <div class="author-comment-text">{{ $authorComment }}</span></div>
        </div>
        {{- end -}}
        {{- end -}}
        {{- /* Comment */ -}}
        {{- partial "comment.html" . -}}
    </div>
    {{- end -}}
</div>
{{- end -}}