User header_wp.html partial in index.html
- Changed header_wp.html and header.html so that they will also work on the homepage (if the current page is the homepage then use the site bigimg/title/subtitle, otherwise use the page bigimg/title/subtitle; need to add them to the scratchpad so that they are accessible outside the scope of the if/else statement). - Change index.html to use the header_wp.html partial instead of duplicating the same code
This commit is contained in:
parent
4d40febe54
commit
730ce3d9d3
3 changed files with 27 additions and 55 deletions
|
|
@ -1,17 +1,18 @@
|
|||
{{ $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>{{ if .Title }}{{ .Title }}{{ else }}<br/>{{ end }}</h1>
|
||||
{{ if .Params.subtitle }}
|
||||
<h1>{{ with $.Scratch.Get "title" }}{{.}}{{ else }}<br/>{{ end }}</h1>
|
||||
{{ if $subtitle }}
|
||||
{{ if eq .Type "page" }}
|
||||
<hr class="small">
|
||||
<span class="{{ .Type }}-subheading">{{ .Params.subtitle }}</span>
|
||||
<span class="{{ .Type }}-subheading">{{ $subtitle }}</span>
|
||||
{{ else }}
|
||||
<h2 class="{{ .Type }}-subheading">{{ .Params.subtitle }}</h2>
|
||||
<h2 class="{{ .Type }}-subheading">{{ $subtitle }}</h2>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if eq .Type "post" }}
|
||||
<span class="post-meta">Posted on {{ .Date.Format .Site.Params.dateFormat }}</span>
|
||||
{{ end }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue