Handle list header in the header partial
This commit is contained in:
parent
475004ea5d
commit
686478883f
2 changed files with 20 additions and 29 deletions
|
|
@ -1,19 +1,3 @@
|
||||||
{{ define "header" }}
|
|
||||||
<header class="header-section ">
|
|
||||||
<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="page-heading">
|
|
||||||
<h1>{{ if .Data.Singular }}#{{ end }}{{ .Title }}</h1>
|
|
||||||
<hr class="small">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
{{ end }}
|
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<div class="container" role="main">
|
<div class="container" role="main">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,10 @@
|
||||||
{{ if .Params.bigimg }}{{ $.Scratch.Set "bigimg" .Params.bigimg }}{{ end }}
|
{{ if .Params.bigimg }}{{ $.Scratch.Set "bigimg" .Params.bigimg }}{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ $bigimg := $.Scratch.Get "bigimg" }}
|
{{ $bigimg := $.Scratch.Get "bigimg" }}
|
||||||
|
{{ $title := $.Scratch.Get "title" }}
|
||||||
|
{{ $subtitle := $.Scratch.Get "subtitle" }}
|
||||||
|
|
||||||
{{ if or $bigimg ($.Scratch.Get "title") }}
|
{{ if or $bigimg $title }}
|
||||||
{{ if $bigimg }}
|
{{ if $bigimg }}
|
||||||
<div id="header-big-imgs" data-num-img={{len $bigimg}} {{range $i, $img := $bigimg}}data-img-src-{{add $i 1}}="{{$img.src | absURL }}" {{ if $img.desc}}data-img-desc-{{add $i 1}}="{{$img.desc}}"{{end}}{{end}}></div>
|
<div id="header-big-imgs" data-num-img={{len $bigimg}} {{range $i, $img := $bigimg}}data-img-src-{{add $i 1}}="{{$img.src | absURL }}" {{ if $img.desc}}data-img-desc-{{add $i 1}}="{{$img.desc}}"{{end}}{{end}}></div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
@ -42,15 +44,20 @@
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<div class="intro-header no-img">
|
<div class="intro-header no-img">
|
||||||
{{ $subtitle := $.Scratch.Get "subtitle" }}
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||||
<div class="{{ .Type }}-heading">
|
<div class="{{ .Type }}-heading">
|
||||||
<h1>{{ with $.Scratch.Get "title" }}{{.}}{{ else }}<br/>{{ end }}</h1>
|
{{ 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 $subtitle }}
|
||||||
{{ if eq .Type "page" }}
|
{{ if eq .Type "page" }}
|
||||||
<hr class="small">
|
|
||||||
<span class="{{ .Type }}-subheading">{{ $subtitle }}</span>
|
<span class="{{ .Type }}-subheading">{{ $subtitle }}</span>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<h2 class="{{ .Type }}-subheading">{{ $subtitle }}</h2>
|
<h2 class="{{ .Type }}-subheading">{{ $subtitle }}</h2>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue