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

single.html « _default « layouts - github.com/chipzoller/hugo-clarity.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2cfeca65b34d260279292ce2fa59050c652a41a0 (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
{{- define "main" }}
{{- $s := .Site.Params }}
{{- $p := .Params }}
{{- $scratch := newScratch }}
{{- if isset $p "image" }}
  {{- $scratch.Set "image" $p.image }}
{{- else }}
  {{ $scratch.Set "image" $s.fallBackOgImage }}
{{- end }}
{{- $image := $scratch.Get "image" }}
{{- $bg := absLangURL (path.Join "images" $image) }}
<div class="{{ if ne $p.singleColumn true }}grid-inverse {{ end }}wrap content">
  <article class="post_content">
    {{- $t := .Title }}
    <h1 class="post_title">{{ $t }}</h1>
    {{- partial "post-meta" . }}
    {{- with .Params.featureImage -}}
      <div class="post_featured">
        {{- partial "image" (dict "file" . "alt" $p.featureImageAlt "cap" $p.featureImageCap "type" "featured" "Page" $.Page) }}
      </div>
    {{- end -}}
    {{ if $p.toc }}
      <div class="post_toc">
        <h2>{{ T "overview" }}</h2>
        {{ .TableOfContents }}
      </div>
    {{ end }}
    <div class="post_body">
      {{- .Content }}
    </div>

    {{- $showRelatedInArticle := true }}
    {{- if eq $s.showRelatedInArticle false }}
      {{- $showRelatedInArticle = false }}
    {{- else if eq $p.showRelatedInArticle false }}
      {{- $showRelatedInArticle = false }}
    {{- end }}
    {{- if ne $showRelatedInArticle false }}
      {{- partial "related" . }}
    {{- end }}

    {{- $showComments := true }}
    {{- if eq $s.comments false }}
      {{- $showComments = false }}
    {{- else if eq $p.comments false }}
      {{- $showComments = false }}
    {{- end }}
    {{- if ne $showComments false }}
      {{- partial "comments" . }}
    {{- end }}
    {{- partial "i18nlist" . }}

  </article>
  {{- if ( ne $p.sidebar false ) }}
    {{- partial "sidebar" . }}
  {{ end }}
</div>
{{- end }}