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: d014b89ffe9104b51e5db23ac828174fa8a9e6ea (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
{{- define "title" }}{{ .Title }} | {{ .Site.Params.Title }}{{ end -}}

{{- define "no-content" -}}
<div class="container content-article">
    {{- $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 -}}

    {{- /* 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 -}}

    {{- $pageTheme := $params.Theme | default .Site.Params.Page.theme | default "classic" -}}
    <article class="{{ if $toc.keepStatic }}page single {{ else }}page single page-toc{{ end }} theme-{{ $pageTheme }}">

        <div class="content-block">
        {{- /* Featured image */ -}}
        {{- $image := $params.featuredimage -}}
        {{- $pageImageHidden := $params.hiddenFeaturedImage -}}
        {{- with .Resources.GetMatch "featured-image" -}}
        {{- $image = .RelPermalink -}}
        {{- end -}}

        {{- if eq $pageTheme "full" -}}
        {{- with $image -}}

        <div class="featured-image" style="background-image: url('{{ $image }}');">

            <div class="post-title">

        {{- end -}}
        {{- end -}}

                <div class="post-all-meta {{ if and $image (eq $pageTheme "full") }} {{ else }} padding-article {{ end }}">
                {{ 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>
        {{- if eq $pageTheme "full" -}}
        {{- with $image -}}
            </div>
        </div>
        {{- end -}}
        {{- end -}}


        <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 */ -}}
            <div class="content" id="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>

            <div class="post">
                {{- /* Footer Post */ -}}
                {{- partial "single/footer.html" . -}}
            </div>
        </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="{{ if $toc.keepStatic }} page single comments {{ else }} page single comments page-toc {{ end }}">
        {{- $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 -}}