CHANGE image handling, ADD partials to reuse structure, REFACTOR

This commit is contained in:
Hoernschen 2025-04-17 16:22:33 +02:00
parent 1265491dee
commit 01dcf04b8a
Signed by: hoernschen
GPG key ID: 37591FAF4E6D3462
36 changed files with 1181 additions and 864 deletions

View file

@ -4,32 +4,33 @@
{{- $odd := .odd }}
{{- $id := "hero"}}
{{if $hero.id}}
{{- $id := $hero.id}}
{{- $id := $hero.id}}
{{else if .id}}
{{- $id := .id }}
{{- $id := .id }}
{{end}}
{{ $template := resources.Get "scss/hero.scss" }}
{{ if $template }}
{{ $index := $template | resources.ExecuteAsTemplate "css/hero.scss" . | resources.ToCSS (dict "outputStyle" "compressed") | fingerprint }}
{{ $index := $template | resources.ExecuteAsTemplate "css/hero.scss" . | resources.ToCSS (dict "outputStyle"
"compressed") | fingerprint }}
<link rel="stylesheet" type="text/css" href="{{ $index.RelPermalink }}">
{{ end }}
<div id="{{ $id }}" class="section {{if eq $odd 0}} section-even {{end}} row hero">
<div class="section-content services">
<div class="hero-description col-5">
<div class="title">
<h1 class="content-title">{{ $hero.title }}</h1>
<div class="divider"></div>
</div>
<p>{{ $content }}</p>
<br />
{{ with $hero.button }}
{{- range .}}
{{ partial "components/button.html" . }}
{{- end }}
{{ end }}
</div>
<div class="hero-icon-container col-7">
<img class="service-icon" alt="{{ $hero.image.alt }}" src="{{ $hero.image.url }}">
</div>
<div class="section-content services">
<div class="hero-description col-5">
{{ with $hero.logo }}
{{- partial "components/image.html" (dict "type" .type "style" .style "url" .url "alt" .alt "width" .width "height" .height) -}}
{{ end }}
{{ partial "components/title.html" $hero.title }}
<p>{{ $content }}</p>
<br />
{{ with $hero.button }}
{{- range .}}
{{ partial "components/button.html" . }}
{{- end }}
{{ end }}
</div>
</div>
<div class="side-image col-7">
{{- partial "components/image.html" $hero.image -}}
</div>
</div>
</div>