oxil-net1
Version:
Oxford Information Labs Netistrar Theme
129 lines (110 loc) • 3.38 kB
HTML
{{- define "main" -}}
{{- $image := .Resources.GetMatch "*featured*" -}}
{{- with .Params.heroImage -}}
{{- $image = $.Page.Resources.GetMatch "*hero*" -}}
{{- end -}}
{{- $imagesrc := "" -}}
{{- with $image -}}
{{- $image = .Resize "600x" -}}
{{- $imagesrc = .RelPermalink -}}
{{- end -}}
{{- $bkImageSnap := "true" -}}
{{- $relatedContentClass := .Params.relatedcontentclass -}}
{{- if eq .Params.hero "true" -}}
{{- if eq .Params.heroStyle "simple" -}}
<section class="brand white-text minH25 flex align-center justify-center flex-col">
<div class="grid px1 px2l"><h1 class="white-text text-center">{{- .Title -}}</h1>
<h5 class="thin ge-text text-center">{{- .Description -}}</h5></div>
</section>
{{- else -}}
<section class="rel px1 px2l minH33 flex flex-col justify-center ">
{{- with $imagesrc -}}
<img class="mask-max-0-75-none abs cover {{- if eq $bkImageSnap "true" }} snap{{- end -}}" src="{{ . -}}" alt="Section background image">
{{- end -}}
<div class="rel grid px1 px2l w ">
<div class="w-40 pt2 pt0l" ><h1 class="s1 bold white-text ">{{- .Title -}}</h1>
<p class=" white-text">{{- .Description -}}</p>
</div>
</div>
</section>
{{- end -}}
{{- end -}}
{{- if eq .Params.breadcrumb "true" -}}
<div class="white">
<div class="gf9">
<div class="grid px1 px2l py150">
<div class="breadcrumb">
{{- partial "breadcrumb" (dict "p1" . "p2" .) -}}
</div>
</div>
</div>
{{- end -}}
{{- with .Params.contentlayout -}}
{{- if eq "style1" . -}}
<div class="grid px1 px2l pt4">
{{- with $.Page.Params.subtitle -}}
<h2 class="purple-text normal borb2 borgn py1">{{- . -}}</h2>
{{- end -}}
<div class="text2col small thin pb4 text-justify">
{{- $.Page.Content -}}
</div>
</div>
{{- end -}}
{{- if eq "style2" . -}}
<div class="grid px1 px2l py4 flex justify-center">
<div class="w-75">
{{- with $.Page.Params.subtitle -}}
<h2 class="normal borb2 py1">{{- . -}}</h2>
{{- end -}}
{{- $.Page.Content -}}
</div>
</div>
{{- end -}}
{{- else -}}
<div class="grid px1 px2l py4 justify-center">
{{- .Content -}}
</div>
{{- end -}}
{{- $ctx := . -}}
{{- with .Params.id -}}
{{- partial . $ctx -}}
{{- end -}}
{{- if eq .Params.childSections "true" -}}
{{- with $sections := .Sections -}}
<div>
<div class="grid flex-grid flex-wrap flex-gutter-3 px1 px2l pt2">
{{- range $sections -}}
{{- partial "sub-section" (dict "ctx" . "relatedContentClass" $relatedContentClass) -}}
{{- end -}}
</div>
</div>
{{- end -}}
{{- end -}}
{{- $pages := where .Site.Pages "Section" .CurrentSection -}}
{{- if eq .Params.regularPages "true" -}}
<div>
<div class="grid flex-grid flex-wrap flex-gutter-3 px1 px2l">
{{ range .RegularPages }}
{{- partial "sub" . -}}
{{- end -}}
</div>
</div>
{{- end -}}
{{- if or (eq .Params.relatedbycategory "true") (eq .Params.relatedbytag "true") -}}
<div class="gf9 py3">
<div class="grid">
<h5 class="px1 px2l uppercase">{{- with .Params.relatedTitle -}}{{- . -}}{{- else -}}Related {{- end -}}</h5>
{{- if eq .Params.relatedbycategory "true" -}}
{{- partial "related-by-categories" . -}}
{{- end -}}
{{- if eq .Params.relatedbytag "true" -}}
{{- partial "related-by-tags" . -}}
{{- end -}}
</div>
</div>
{{- end -}}
{{- if eq .Params.prevnext "true" -}}
{{- partial "prev-next" . -}}
{{- end -}}
</div>
{{- end -}}