Files
HugoBlox-kit/layouts/partials/widget_page.html
T
George Cushen a4ffd6efc5 feat(widget): add css_class option to customize widget style
Allows user to customize the style of a particular widget using the CSS
plugin feature. For example, the background of a widget could be changed
to an image or gradient.

Close #322
2019-02-07 14:37:21 +00:00

32 lines
979 B
HTML

{{ 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 }}
{{ $params := dict "root" $ "page" $page }}
{{ $widget := printf "widgets/%s.html" ( or $page.Params.widget "custom" ) }}
{{ if in (slice "hero" "hero_carousel") $page.Params.widget }}
{{ partial $widget $params }}
{{ else }}
<section id="{{ $page.File.TranslationBaseName }}" class="home-section{{ with $page.Params.css_class }} {{ . }}{{ end }}">
<div class="container">
{{ partial $widget $params }}
</div>
</section>
{{ end }}
{{ end }}
<!-- Page Footer -->
{{ partial "footer_container.html" . }}
{{ partial "footer.html" . }}