FIX image display in hero section; ADD template for tag display

This commit is contained in:
Hoernschen 2022-06-29 13:03:51 +02:00
parent 849e66eafc
commit d9d8befe21
Signed by: hoernschen
GPG key ID: 37591FAF4E6D3462
6 changed files with 54 additions and 10 deletions

View file

@ -8,6 +8,7 @@
.hero-icon-container { .hero-icon-container {
padding: 1rem; padding: 1rem;
margin: auto;
} }
.hero-button { .hero-button {

View file

@ -287,10 +287,16 @@ button {
} }
.services { .services {
display: inherit; display: flex;
align-items: center;
padding: 1.5rem 0rem; padding: 1.5rem 0rem;
} }
.services-section-content {
display: flex;
align-items: center;
}
.service-icon-container { .service-icon-container {
padding: 1.5rem; padding: 1.5rem;
margin: auto; margin: auto;
@ -299,6 +305,7 @@ button {
.service-icon { .service-icon {
width: 100%; width: 100%;
height: auto; height: auto;
object-fit: contain;
} }
.service-button { .service-button {

View file

@ -1,11 +1,17 @@
{{ define "main" }} {{ define "main" }}
{{ if .Params.id }} {{ if .Content }}
{{- partial "hero.html" (dict "hero" .Params "color" .Site.Params.color "odd" 0) -}} <div class="content">
{{ with .Title }}
<div class="title">
<h1 class="content-title">{{ . }}</h1>
<div class="divider"></div>
</div>
{{ end }} {{ end }}
{{.Content}} {{.Content}}
<div> </div>
{{ end }}
{{- range $index, $page := .Pages }} {{- range $index, $page := .Pages }}
{{ $odd := mod (add $index 1) 2 }} {{ $odd := mod $index 2 }}
{{ if eq .Params.type "slider" }} {{ if eq .Params.type "slider" }}
{{- partial "slider.html" (dict "id" $page.File.ContentBaseName "slider" .Params "color" $.Site.Params.color "odd" $odd) -}} {{- partial "slider.html" (dict "id" $page.File.ContentBaseName "slider" .Params "color" $.Site.Params.color "odd" $odd) -}}
{{ else if eq .Params.type "hero" }} {{ else if eq .Params.type "hero" }}
@ -22,5 +28,4 @@
{{- partial "links.html" (dict "id" $page.File.ContentBaseName "links" .Params "defaultimage" $.Site.Params.defaultimage "odd" $odd) -}} {{- partial "links.html" (dict "id" $page.File.ContentBaseName "links" .Params "defaultimage" $.Site.Params.defaultimage "odd" $odd) -}}
{{ end }} {{ end }}
{{ end }} {{ end }}
</div>
{{ end }} {{ end }}

View file

@ -1,7 +1,11 @@
{{ define "main" }} {{ define "main" }}
{{ with .Params.image }} {{ with .Params.image }}
{{ if .url }}
<img class="coverimage" src="{{ .url }}" />
{{ else }}
<img class="coverimage" src="{{ . }}" /> <img class="coverimage" src="{{ . }}" />
{{ end }} {{ end }}
{{ end }}
<div class="content"> <div class="content">
{{ with .Title }} {{ with .Title }}
<div class="title"> <div class="title">

View file

@ -0,0 +1,27 @@
{{ define "main" }}
<div class="content">
<article>
<div class="title">
<h1 class="content-title">{{ .Title }}</h1>
<div class="divider"></div>
</div>
{{.Content}}
</article>
<div class="cardList">
{{ range .Pages }}
<a href="{{.Permalink}}">
<div class="card">
{{ if .Params.image }}
<img class="cardImage" src="{{ .Params.image }}" />
{{ else }}
<img class="cardImage" src="{{ $.Site.Params.defaultimage }}" />
{{ end }}
<div class="cardTitle">{{.Title}}</div>
<div class="cardDescription">{{ .Content | safeHTML | truncate 250 }}</div>
<div class="cardDetail">{{.Date.Format "02.01.2006"}} | {{.ReadingTime}} Minuten</div>
</div>
</a>
{{ end }}
</div>
</div>
{{ end }}

View file

@ -13,7 +13,7 @@
<link rel="stylesheet" type="text/css" href="{{ $index.RelPermalink }}"> <link rel="stylesheet" type="text/css" href="{{ $index.RelPermalink }}">
{{ end }} {{ end }}
<div id="{{ $id }}" class="section {{if eq $odd 0}} section-even {{end}} row hero"> <div id="{{ $id }}" class="section {{if eq $odd 0}} section-even {{end}} row hero">
<div class="section-content"> <div class="section-content services">
<div class="hero-description col-5"> <div class="hero-description col-5">
<div class="title"> <div class="title">
<h1 class="content-title">{{ $hero.title }}</h1> <h1 class="content-title">{{ $hero.title }}</h1>