Welcome to mirror list, hosted at ThFree Co, Russian Federation.

sections.html « partials « layouts - github.com/danielkvist/hugo-piercer-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 986eee0cef6f1be338495b643472887cdbc6a2b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{{ $items := (where $.Site.RegularPages "Type" "sections") }}

{{ range $items }}

{{ $bkg := "" }}
{{ $bc := "" }}

{{ if .Params.images }}
{{ if gt (len .Params.images) 0 }}
{{ $bkgImage := print (index .Params.images 0) }}
{{ $bkgURL := printf "%s%s" $.Site.BaseURL $bkgImage }}
{{ $bkg = printf "%s%s%s" "background-image: url('" $bkgURL "');"}}
{{ end }}
{{ end }}

{{ if .Params.borderColor }}
{{ $bc = printf "%s%s%s" "border-bottom: 5px solid var(--" (.Params.borderColor) ");"}}
{{ end }}


<section class="section bkg-image" id="{{ .Title }}" style="{{ safeCSS $bkg }} {{ safeCSS $bc }}">
    <h1 class="section__title">{{ .Title }}</h1>
    {{ .Content }}
</section>

{{ end }}