uci-hugo-landingpage/layouts/partials/sections.html

17 lines
837 B
HTML

<!-- Renders Section Based on Content -->
{{ $.Scratch.Set "offset" 0 }}
{{ range $i, $e := where ( where .Site.RegularPages "Section" "sections" ) ".Params.hidden" "!=" true }}
{{ if eq .File.BaseFileName "hero" }}{{ $.Scratch.Set "offset" 1 }}{{ end }}
{{ $j := add ( $.Scratch.Get "offset" ) $i }}
<section id="{{ .File.BaseFileName }}" class="section section--{{ .File.BaseFileName }} {{ if ne .File.BaseFileName "hero" }}section--{{ if modBool $j 2 }}odd{{ else }}even{{ end }}{{ end }}">
<div class="section__container">
<div class="section__headline section__headline--{{ .File.BaseFileName }}">
<h1>{{ .Title }}</h1>
</div>
<div class="section__content section-content--{{ .File.BaseFileName }}" {{ with .Params.align }} style="align-items: {{.}};"{{ end }} >
{{ .Content }}
</div>
</div>
</section>
{{ end }}