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

single.html « post « layouts - github.com/Softorage/HugoTheme-VibrantShadows.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7e4922adf28c2099fbc8be120636ca831c50ad86 (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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
{{ define "main" }}
<div class="container-fluid  text-light text-center {{- if and (ne site.Params.backgImage.post "disable") (.Params.image.src) }} py-5{{ else }} bg-clr1 pb-3 pt-4 shadow{{ end }} position-relative"
{{- if and (ne site.Params.backgImage.post "disable") (.Params.image.src) }}
 style="background: url('{{ .Params.image.src | safeURL }}') 50% 95% / cover no-repeat fixed; box-shadow: inset 2000px 0 0 0 rgba(0, 0, 0, 0.65);"
{{- end -}}
>
  <div style="height:3.5rem;"></div>
  <h1>{{ .Title }}</h1>
  <p class="description">{{ .Description }}</p>
</div>
<div class="container-fluid bg-nav p-4">
  <div class="row">
    <div class="col-md-3">
      {{ if or (ne .Params.toc false) (ne .Params.toc "false") }}
      <div class="bg-mat p-4 rounded" style="overflow-x: auto;">
        <div class="h4 mb-3">
        Contents
        </div>
        {{ .TableOfContents }}
      </div>
      {{ end }}
    </div>
    <div class="col-md-9">
      {{- $postMetaTop := false }}
      {{- $postMetaBottom := false }}
      {{- range site.Params.position.postMeta }}
        {{- if eq .content "top" }}
          {{- $postMetaTop = true }}
        {{- else if eq .content "bottom" }}
          {{- $postMetaBottom = true }}
        {{- end }}
      {{- end }}
        
      {{ if or (and site.Params.social.share (eq site.Params.position.social.share "top")) (and site.Params.position.postMeta $postMetaTop) (and (site.Params.position.postMeta.tags.content) (eq site.Params.position.postMeta.tags.content "top")) }}
      <div class="py-1">
        <div class="row">
          {{- if and site.Params.position.postMeta $postMetaTop }}
          <div class="col-md-7 small text-muted post-meta my-auto">
            
            {{- $wordCount := "" }}
            {{- $readingTime := "" }}
            {{- $author := "" }}
            {{- $lastUpdated := "" }}
            
            {{- if and site.Params.position.postMeta.wordCount.content (eq site.Params.position.postMeta.wordCount.content "top") }}
              {{- $wordCount = print (.WordCount) " words" }}
            {{- end }}
            {{- if and site.Params.position.postMeta.readingTime.content (eq site.Params.position.postMeta.readingTime.content "top") }}
              {{- $readingTime = print (lang.NumFmt 0 (div .WordCount 130)) " min read" -}}
            {{- end }}
            {{- if and site.Params.position.postMeta.author.content (eq site.Params.position.postMeta.author.content "top") }}
              {{- $author = print "By " (default site.Params.meta.author .Params.author) }}
            {{- end }}
            {{- if .Lastmod }}
              {{- if and site.Params.position.postMeta.lastUpdated.content (eq site.Params.position.postMeta.lastUpdated.content "top") }}
                {{- $lastUpdated = print "<span class=''>Last updated: " (.Lastmod.Format "January 2, 2006") }}</span>
              {{- end }}
            {{- end }}
            
            {{- $postMetaPre := slice $author $wordCount $readingTime $lastUpdated }}
            {{ $postMeta := slice }}
            {{ range $postMetaPre }}
              {{ if . }}
                {{ $postMeta = $postMeta | append . }}
              {{ end }}
            {{ end }}
            
            {{- delimit $postMeta " &#183; " -}}
          
          </div>
          {{ end }}
          
          {{ if and site.Params.social.share (eq site.Params.position.social.share "top") }}
          <div class="col-md-auto ml-3 my-auto">
            <div class="row">
              <div class="col-auto p-0 my-auto">
              Share on:&nbsp;&nbsp;
              </div>
              <div class="col p-0">
                <span class="lead">
                  {{ if in site.Params.social.share "facebook" }}
                    <a href="https://www.facebook.com/sharer/sharer.php?u={{ .Permalink }}&quote={{ .Title }}" rel="noreferrer nofollow" target="_blank" title="Share on Facebook" aria-label="Share on Facebook"><span class="fab fa-facebook"></span></a>&nbsp;&nbsp;
                  {{ end }}
                  {{ if in site.Params.social.share "twitter" }}
                    <a href="https://twitter.com/intent/tweet?source={{ .Permalink }}&text={{ .Title }}:%0A{{ .Permalink }}" rel="noreferrer nofollow" target="_blank" title="Share on Twitter" aria-label="Share on Twitter"><span class="fab fa-twitter"></span></a>&nbsp;&nbsp;
                  {{ end }}
                  {{ if in site.Params.social.share "linkedin" }}
                    <a href="https://www.linkedin.com/shareArticle?mini=true&url={{ .Permalink }}&title={{ .Title }}&summary={{ .Params.description }}&source={{ site.Title }}" rel="noreferrer nofollow" target="_blank" title="Share on LinkedIn" aria-label="Share on LinkedIn"><span class="fab fa-linkedin"></span></a>&nbsp;&nbsp;
                  {{ end }}
                  {{ if in site.Params.social.share "telegram" }}
                    <a href="https://t.me/share/url?url={{ .Permalink }}&text={{ .Title }}" rel="noreferrer nofollow" target="_blank" title="Share on Telegram" aria-label="Share on Telegram"><span class="fab fa-telegram"></span></a>&nbsp;&nbsp;
                  {{ end }}
                  {{ if in site.Params.social.share "whatsapp" }}
                    <a href="whatsapp://send?text={{ .Permalink }}%0A%0A{{ .Title }}" data-text="{{ .Title }}" data-href="{{ .Permalink }}" rel="noreferrer nofollow" target="_blank" title="Share on Whatsapp" aria-label="Share on Whatsapp"><span class="fab fa-whatsapp"></span></a>&nbsp;&nbsp;
                  {{ end }}
                  {{ if in site.Params.social.share "reddit" }}
                    <a href="https://reddit.com/submit?url={{ .Permalink }}&title={{ .Title }}" rel="noreferrer nofollow" target="_blank" title="Share on Reddit" aria-label="Share on Reddit"><span class="fab fa-reddit"></span></a>&nbsp;&nbsp;
                  {{ end }}
                  {{ if in site.Params.social.share "email" }}
                    <a href="mailto:?subject={{ .Title }}&body={{ .Params.description }}%0A%0A{{ .Permalink }}" target="_blank" title="Share via email" aria-label="Share via email"><span class="fas fa-envelope"></span></a>
                  {{ end }}
                </span>
              </div>
            </div>
          </div>
          {{ end }}
        </div>
        
        {{ if and (site.Params.position.postMeta.tags.content) (eq site.Params.position.postMeta.tags.content "top") }}
          <div class="pt-2 pb-3">
          {{- range .Params.tags -}}
            <a href="/tags/{{ . | urlize }}/"><span class="badge badge-pill bg-clr2 text-nav mr-2 py-2">#{{ . | humanize | upper }}</span></a>
          {{- end -}}
          </div>
        {{ end }}
        
      </div>
      {{ end }}
      
      <div class="py-3 my-2">
      {{ .Content }}
      </div>
      
      {{ if or (and site.Params.social.share (eq site.Params.position.social.share "bottom")) (and site.Params.position.postMeta $postMetaBottom) (and (site.Params.position.postMeta.tags.content) (eq site.Params.position.postMeta.tags.content "bottom")) }}
      <div class="pt-4 mt-2 border-top">
        <div class="row">
          {{- if and site.Params.position.postMeta $postMetaBottom }}
          <div class="col-md-7 small text-muted post-meta my-1">
          
            {{- $wordCount := "" }}
            {{- $readingTime := "" }}
            {{- $author := "" }}
            {{- $lastUpdated := "" }}
            
            {{- if and site.Params.position.postMeta.wordCount.content (eq site.Params.position.postMeta.wordCount.content "bottom") }}
              {{- $wordCount = print (.WordCount) " words" }}
            {{- end }}
            {{- if and site.Params.position.postMeta.readingTime.content (eq site.Params.position.postMeta.readingTime.content "bottom") }}
              {{- $readingTime = print (lang.NumFmt 0 (div .WordCount 130)) " min read" -}}
            {{- end }}
            {{- if and site.Params.position.postMeta.author.content (eq site.Params.position.postMeta.author.content "bottom") }}
              {{- $author = print "By " (default site.Params.meta.author .Params.author) }}
            {{- end }}
            {{- if .Lastmod }}
              {{- if and site.Params.position.postMeta.lastUpdated.content (eq site.Params.position.postMeta.lastUpdated.content "bottom") }}
                {{- $lastUpdated = print "<span class=''>Last updated: " (.Lastmod.Format "January 2, 2006") }}</span>
              {{- end }}
            {{- end }}
            
            {{- $postMetaPre := slice $author $wordCount $readingTime $lastUpdated }}
            {{ $postMeta := slice }}
            {{ range $postMetaPre }}
              {{ if . }}
                {{ $postMeta = $postMeta | append . }}
              {{ end }}
            {{ end }}
            
            {{- delimit $postMeta " &#183; " -}}
          
          </div>
          {{ end }}
          
          {{ if and site.Params.social.share (eq site.Params.position.social.share "bottom") }}
          <div class="col-md-auto ml-3 my-1">
            <div class="row">
              <div class="col-auto p-0">
              Share on:&nbsp;&nbsp;
              </div>
              <div class="col p-0">
                <span class="lead">
                  {{ if in site.Params.social.share "facebook" }}
                    <a href="https://www.facebook.com/sharer/sharer.php?u={{ .Permalink }}&quote={{ .Title }}" rel="noreferrer nofollow" target="_blank" title="Share on Facebook" aria-label="Share on Facebook"><span class="fab fa-facebook"></span></a>&nbsp;&nbsp;
                  {{ end }}
                  {{ if in site.Params.social.share "twitter" }}
                    <a href="https://twitter.com/intent/tweet?source={{ .Permalink }}&text={{ .Title }}:%0A{{ .Permalink }}" rel="noreferrer nofollow" target="_blank" title="Share on Twitter" aria-label="Share on Twitter"><span class="fab fa-twitter"></span></a>&nbsp;&nbsp;
                  {{ end }}
                  {{ if in site.Params.social.share "linkedin" }}
                    <a href="https://www.linkedin.com/shareArticle?mini=true&url={{ .Permalink }}&title={{ .Title }}&summary={{ .Params.description }}&source={{ site.Title }}" rel="noreferrer nofollow" target="_blank" title="Share on LinkedIn" aria-label="Share on LinkedIn"><span class="fab fa-linkedin"></span></a>&nbsp;&nbsp;
                  {{ end }}
                  {{ if in site.Params.social.share "telegram" }}
                    <a href="https://t.me/share/url?url={{ .Permalink }}&text={{ .Title }}" rel="noreferrer nofollow" target="_blank" title="Share on Telegram" aria-label="Share on Telegram"><span class="fab fa-telegram"></span></a>&nbsp;&nbsp;
                  {{ end }}
                  {{ if in site.Params.social.share "whatsapp" }}
                    <a href="whatsapp://send?text={{ .Permalink }}%0A%0A{{ .Title }}" data-text="{{ .Title }}" data-href="{{ .Permalink }}" rel="noreferrer nofollow" target="_blank" title="Share on Whatsapp" aria-label="Share on Whatsapp"><span class="fab fa-whatsapp"></span></a>&nbsp;&nbsp;
                  {{ end }}
                  {{ if in site.Params.social.share "reddit" }}
                    <a href="https://reddit.com/submit?url={{ .Permalink }}&title={{ .Title }}" rel="noreferrer nofollow" target="_blank" title="Share on Reddit" aria-label="Share on Reddit"><span class="fab fa-reddit"></span></a>&nbsp;&nbsp;
                  {{ end }}
                  {{ if in site.Params.social.share "email" }}
                    <a href="mailto:?subject={{ .Title }}&body={{ .Params.description }}%0A%0A{{ .Permalink }}" target="_blank" title="Share via email" aria-label="Share via email"><span class="fas fa-envelope"></span></a>
                  {{ end }}
                </span>
              </div>
            </div>
          </div>
          {{ end }}
        </div>
      
        {{ if and (site.Params.position.postMeta.tags.content) (eq site.Params.position.postMeta.tags.content "bottom") }}
          <div class="mt-3">
            {{- range .Params.tags -}}
              <a href="/tags/{{ . | urlize }}/"><span class="badge badge-pill bg-clr2 text-nav mr-2 py-2">#{{ . | humanize | upper }}</span></a>
            {{- end -}}
          </div>
        {{ end }}
      
      </div>
      {{ end }}
    </div>
  </div>
  
  {{ if site.DisqusShortname }}
  <div class="my-5">
  {{ if eq hugo.Environment "production" -}}
    {{ template "_internal/disqus.html" . }}
  {{ else }}
    <p class="lead text-center">This is where Disqus comments would appear on production website.</p>
  {{ end }}
  </div>
  {{ end }}
  
</div>
{{ end }}