123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- {{ partial "header.html" . }}
- {{ partial "navbar.html" . }}
- <!-- Flag for jQuery -->
- <span id="homepage" style="display: none"></span>
- {{ if .IsHome }}
- {{ .Scratch.Set "section" "home" }}
- {{ else }}
- {{ .Scratch.Set "section" .Section }}
- {{ end }}
- {{ $section := .Scratch.Get "section" }}
- <!-- Widgets -->
- {{ range $index, $page := where (where .Data.Pages "Section" $section) ".Params.active" "!=" false }}
- {{/* Begin widget styling */}}
- {{ $bg := $page.Params.background }}
- {{ $style := "" }}
- {{ if $bg.color }}
- {{ $style = printf "background-color: %s;" ($bg.color | default "transparent") }}
- {{ end }}
- {{ if and $bg.gradient_start $bg.gradient_end }}
- {{ $style = printf "%sbackground-image: linear-gradient(%s, %s);" $style $bg.gradient_start $bg.gradient_end }}
- {{ end }}
- {{ if $bg.image }}
- {{ $darken := "" }}
- {{ if $bg.image_darken }}
- {{ $darken = printf "linear-gradient(rgba(0, 0, 0, %s), rgba(0, 0, 0, %s))," (string $bg.image_darken) (string $bg.image_darken) }}
- {{ end }}
- {{/* See Hugo note on linking assets in styles: https://github.com/gohugoio/hugoThemes#common-permalink-issues */}}
- {{ $style = printf "%sbackground-image: %s url('%s');" $style $darken (printf "img/%s" $bg.image | absURL) }}
- {{ end }}
- {{ with $page.Params.css_custom }}
- {{ $style = print $style . }}
- {{ end }}
- {{ $params := dict "root" $ "page" $page }}
- {{ $widget := or $page.Params.widget "custom" }}
- {{ $widget_path := printf "widgets/%s.html" $widget }}
- {{ if in (slice "slider") $widget }}
- {{ partial $widget_path $params }}
- {{ else }}
- <section id="{{ $page.File.TranslationBaseName }}" class="home-section {{ printf "wg-%s" (replace $widget "_" "-") }} {{if $bg.text_color_light}}dark{{end}} {{if $bg.image}}parallax{{end}} {{ with $page.Params.css_class }}{{ . }}{{ end }}" {{with $style}}style="{{. | safeCSS}}"{{end}}>
- <div class="container">
- {{ partial $widget_path $params }}
- </div>
- </section>
- {{ end }}
- {{ end }}
- <!-- Page Footer -->
- {{ partial "footer_container.html" . }}
- {{ partial "footer.html" . }}
|