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

@ -1,27 +1,24 @@
{{ define "main" }}
{{ with .Params.image }}
{{ if .url }}
<img class="coverimage" src="{{ .url }}" alt="{{ .alt }}" />
{{- partial "components/image.html" (dict "style" "coverimage" "url" .url "alt" .alt) -}}
{{ else }}
<img class="coverimage" src="{{ . }}" />
{{- partial "components/image.html" (dict "style" "coverimage" "url" .) -}}
{{ end }}
{{ end }}
{{ if .Content }}
<div class="content">
{{ with .Title }}
<div class="title">
<h1 class="content-title">{{ . }}</h1>
<div class="divider"></div>
</div>
{{ partial "components/title.html" . }}
{{ end }}
{{.Content}}
</div>
{{ else }}
{{ else if .Params.header.enabled }}
<div class="header-blocker"></div>
{{ end }}
{{- range $index, $page := .Pages }}
{{ $odd := mod $index 2 }}
{{ $id := .Params.id | default $page.File.ContentBaseName }}
{{ $id := .Params.id | default $page.Name }}
{{ if eq .Params.type "slider" }}
{{- partial "slider.html" (dict "id" $id "slider" .Params "color" $.Site.Params.color "odd" $odd) -}}
{{ else if eq .Params.type "hero" }}