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

header.html « partials « layouts - github.com/halogenica/beautifulhugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 21825345beb61fbc009d501d2d3a3b77dc704c6e (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
{{- partial "load-photoswipe-theme.html" . }}

{{ if .IsHome }}
  {{ if .Site.Params.homeTitle }}{{ $.Scratch.Set "title" .Site.Params.homeTitle }}{{ else }}{{ $.Scratch.Set "title" .Site.Title }}{{ end }}
  {{ if .Site.Params.subtitle }}{{ $.Scratch.Set "subtitle" .Site.Params.subtitle }}{{ end }}
  {{ if .Site.Params.bigimg }}{{ $.Scratch.Set "bigimg" .Site.Params.bigimg }}{{ end }}
{{ else }}
  {{ $.Scratch.Set "title" .Title }}
  {{ if .Params.subtitle }}{{ $.Scratch.Set "subtitle" .Params.subtitle }}{{ end }}
  {{ if .Params.bigimg }}{{ $.Scratch.Set "bigimg" .Params.bigimg }}{{ end }}
{{ end }}
{{ $bigimg := $.Scratch.Get "bigimg" }}
{{ $title := $.Scratch.Get "title" }}
{{ $subtitle := $.Scratch.Get "subtitle" }}

{{ if or $bigimg $title }}
  {{ if $bigimg }}
    <div id="header-big-imgs" data-num-img={{len $bigimg}} 
      {{range $i, $img := $bigimg}}
         {{ if (fileExists $img.src)}} 
          data-img-src-{{add $i 1}}="{{$img.src | absURL }}" 
         {{else}}
          data-img-src-{{add $i 1}}="{{$img.src}}" 
         {{end}}
         {{ if $img.desc}}data-img-desc-{{add $i 1}}="{{$img.desc}}"{{end}}
      {{end}}></div>
  {{ end }}

  <header class="header-section {{ if $bigimg }}has-img{{ end }}">
    {{ if $bigimg }}
      <div class="intro-header big-img">
        {{ $subtitle := $.Scratch.Get "subtitle" }}
        <div class="container">
          <div class="row">
            <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
              <div class="{{ .Type }}-heading">
                <h1>{{ with $.Scratch.Get "title" }}{{.}}{{ else }}<br/>{{ end }}</h1>
                  {{ if $subtitle }}
                    {{ if eq .Type "page" }}
                      <hr class="small">
                      <span class="{{ .Type }}-subheading">{{ $subtitle }}</span>
                    {{ else }}
                      <h2 class="{{ .Type }}-subheading">{{ $subtitle }}</h2>
                    {{ end }}
                  {{ end }}
                  {{ if eq .Type "post" }}
                    {{ partial "post_meta.html" . }}
                  {{ end }}
              </div>
            </div>
          </div>
        </div>
        <span class="img-desc" style="display: inline;"></span>
      </div>
    {{end}}
    <div class="intro-header no-img">
      <div class="container">
        <div class="row">
          <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
            <div class="{{ .Type }}-heading">
              {{ if eq .Type "list" }}
                <h1>{{ if .Data.Singular }}#{{ end }}{{ .Title }}</h1>
              {{ else }}
                <h1>{{ with $title }}{{.}}{{ else }}<br/>{{ end }}</h1>
              {{ end }}
              {{ if ne .Type "post" }}
                <hr class="small">
              {{ end }}
              {{ if $subtitle }}
                {{ if eq .Type "page" }}
                  <span class="{{ .Type }}-subheading">{{ $subtitle }}</span>
                {{ else }}
                  <h2 class="{{ .Type }}-subheading">{{ $subtitle }}</h2>
                {{ end }}
              {{ end }}
              {{ if eq .Type "post" }}
                {{ partial "post_meta.html" . }}
              {{ end }}
            </div>
          </div>
        </div>
      </div>
    </div>
  </header>
{{ else }}
  <div class="intro-header"></div>
{{ end }}