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

23 lines
1.0 KiB
HTML

<!-- Renders Section Based on Content -->
{{ if eq .Site.Params.sections.offset true }}{{ $.Scratch.Set "offset" 0 }}{{ else }}{{ $.Scratch.Set "offset" 1 }}{{ end }}
{{ if eq .Site.Params.use_hero true }}{{ $.Scratch.Set "offset" 1 }}{{ end }}
{{ range $i, $e := where ( where .Site.RegularPages "Section" "sections" ) ".Params.hidden" "!=" true }}
{{ $j := add ( $.Scratch.Get "offset" ) $i }}
<section id="{{ .File.BaseFileName }}" class="section section--{{ .File.BaseFileName }} section--{{ if modBool $j 2 }}even{{ else }}odd{{ end }}"
style="color:{{ .Params.color }}; background-color:{{ .Params.bg_color }};"
>
<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:
{{ if eq . "left" }} flex-start {{ end }}
{{ if eq . "right" }} flex-end {{ end }};"
{{ end }} >
{{ .Content }}
</div>
</div>
</section>
{{ end }}