ADD Image description, REFACTORING

This commit is contained in:
Hoernschen 2022-07-08 17:35:15 +02:00
parent 0ded2e9138
commit 327f17dd39
Signed by: hoernschen
GPG key ID: 37591FAF4E6D3462
13 changed files with 45 additions and 55 deletions

View file

@ -419,7 +419,7 @@ button {
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
max-width: 350px; max-width: 350px;
height: 400px; height: 400px;
margin: 5px; margin: auto;
justify-content: center; justify-content: center;
} }

View file

@ -1,5 +1,5 @@
{{ define "main" }} {{ define "main" }}
<div class="notfound"> <div class="notfound">
<img class="notfoundimage" src="/images/undraw_page_not_found_su7k.svg"> <img class="notfoundimage" src="/images/undraw_page_not_found_su7k.svg" alt="Not Found Image">
</div> </div>
{{ end }} {{ end }}

View file

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

View file

@ -9,18 +9,20 @@
</article> </article>
<div class="cardList"> <div class="cardList">
{{ range .Pages }} {{ range .Pages }}
<a href="{{.Permalink}}">
<div class="card"> <div class="card">
<a href="{{.Permalink}}">
<div class="cardContent">
{{ if .Params.image }} {{ if .Params.image }}
<img class="cardImage" src="{{ .Params.image }}" /> <img class="cardImage {{ if eq .Params.image.cover false }} noCover {{ end }}" alt="{{ .Params.image.alt }}" src="{{ .Params.image.url }}" />
{{ else }} {{ else }}
<img class="cardImage" src="{{ $.Site.Params.defaultimage }}" /> <img class="cardImage" src="{{ .Site.Params.defaultimage }}" alt="Default Image" />
{{ end }} {{ end }}
<div class="cardTitle">{{.Title}}</div> <div class="cardTitle">{{.Title}}</div>
<div class="cardDescription">{{ .Content | safeHTML | truncate 250 }}</div> <div class="cardDescription">{{ .Content | safeHTML | truncate 250 }}</div>
<div class="cardDetail">{{.Date.Format "02.01.2006"}} | {{.ReadingTime}} Minuten</div> <div class="cardDetail">{{.Date.Format "02.01.2006"}} | {{.ReadingTime}} Minuten</div>
</div> </div>
</a> </a>
</div>
{{ end }} {{ end }}
</div> </div>
</div> </div>

View file

@ -13,7 +13,7 @@
<div class="progress"></div> <div class="progress"></div>
<header class="header" id="header"> <header class="header" id="header">
<div class="header-container"> <div class="header-container">
<a class="home" href="/#"><img id="logo" class="logo" src="{{ .Site.Params.logo }}"></a> <a class="home" href="/#"><img id="logo" class="logo" src="{{ .Site.Params.logo }}" alt="Logo"></a>
<div class="header-items" id="header-items"> <div class="header-items" id="header-items">
{{- range $links}} {{- range $links}}
{{ if .links }} {{ if .links }}

View file

@ -33,20 +33,6 @@
</div> </div>
</a> </a>
</div> </div>
{{/* <a href="{{ .url }}">
<div class="mediumCard">
{{ if .image }}
<img class="cardImage" alt="{{ .image.alt }}" src="{{ .image.url }}" />
{{ else if .icon }}
<div class="cardImage">
<i class="fas fa-{{ .icon }} cardIcon"></i>
</div>
{{ else }}
<img class="cardImage" alt="default image" src="{{ $defaultimage }}" />
{{ end }}
<div class="cardTitle">{{.title}}</div>
</div>
</a> */}}
{{- end}} {{- end}}
</div> </div>
</div> </div>

View file

@ -20,9 +20,9 @@
<a href="{{.Permalink}}"> <a href="{{.Permalink}}">
<div class="cardContent"> <div class="cardContent">
{{ if .Params.image }} {{ if .Params.image }}
<img class="cardImage {{ if eq .Params.image.cover false }} noCover {{ end }}" src="{{ .Params.image.url }}" /> <img class="cardImage {{ if eq .Params.image.cover false }} noCover {{ end }}" alt="{{ .Params.image.alt }}" src="{{ .Params.image.url }}" />
{{ else }} {{ else }}
<img class="cardImage" src="{{ $defaultimage }}" /> <img class="cardImage" src="{{ $defaultimage }}" alt="Defaul Image" />
{{ end }} {{ end }}
<div class="cardTitle">{{.Title}}</div> <div class="cardTitle">{{.Title}}</div>
<div class="cardDescription">{{ .Content | safeHTML | truncate 250 }}</div> <div class="cardDescription">{{ .Content | safeHTML | truncate 250 }}</div>

View file

@ -11,7 +11,7 @@
<div class="section-content services"> <div class="section-content services">
{{if and ($service.image) (eq $service.image.direction "left")}} {{if and ($service.image) (eq $service.image.direction "left")}}
<div class="service-icon-container col-4"> <div class="service-icon-container col-4">
<img class="service-icon" src="{{ $service.image.url }}"> <img class="service-icon" src="{{ $service.image.url }}" alt="{{ $service.image.alt }}">
</div> </div>
{{end}} {{end}}
<div class="service-description {{if $service.image}} col-8 {{end}}"> <div class="service-description {{if $service.image}} col-8 {{end}}">
@ -26,7 +26,7 @@
</div> </div>
{{if and ($service.image) (eq $service.image.direction "right")}} {{if and ($service.image) (eq $service.image.direction "right")}}
<div class="service-icon-container col-4"> <div class="service-icon-container col-4">
<img class="service-icon" src="{{ $service.image.url }}"> <img class="service-icon" src="{{ $service.image.url }}" alt="{{ $service.image.alt }}">
</div> </div>
{{end}} {{end}}
</div> </div>

View file

@ -19,9 +19,9 @@
<a href="{{.Permalink}}"> <a href="{{.Permalink}}">
<div class="teammember"> <div class="teammember">
{{ if .Params.image }} {{ if .Params.image }}
<img class="avatar" src="{{ .Params.image }}" alt="Avatar"> <img class="avatar" src="{{ .Params.image }}" alt="{{ .Params.name }} Avatar">
{{ else }} {{ else }}
<img class="avatar" src="{{ $defaultimage }}" alt="Avatar"> <img class="avatar" src="{{ $defaultimage }}" alt="Default Avatar">
{{ end }} {{ end }}
<h1 class="teammember-title">{{ .Params.name }}</h1> <h1 class="teammember-title">{{ .Params.name }}</h1>
{{- range .Params.jobs }} {{- range .Params.jobs }}

View file

@ -15,9 +15,9 @@
<a href="{{.Permalink}}"> <a href="{{.Permalink}}">
<div class="cardContent"> <div class="cardContent">
{{ if .Params.image }} {{ if .Params.image }}
<img class="cardImage {{ if eq .Params.image.cover false }} noCover {{ end }}" src="{{ .Params.image.url }}" /> <img class="cardImage {{ if eq .Params.image.cover false }} noCover {{ end }}" alt="{{ .Params.image.alt }}" src="{{ .Params.image.url }}" />
{{ else }} {{ else }}
<img class="cardImage" src="{{ .Site.Params.defaultimage }}" /> <img class="cardImage" src="{{ .Site.Params.defaultimage }}" alt="Default Image" />
{{ end }} {{ end }}
<div class="cardTitle">{{.Title}}</div> <div class="cardTitle">{{.Title}}</div>
<div class="cardDescription">{{ .Content | safeHTML | truncate 250 }}</div> <div class="cardDescription">{{ .Content | safeHTML | truncate 250 }}</div>

View file

@ -41,7 +41,7 @@
{{ define "main" }} {{ define "main" }}
{{ with .Params.image }} {{ with .Params.image }}
<img class="coverimage {{ if eq .cover false }} noCover {{ end }}" src="{{ .url }}" /> <img class="coverimage {{ if eq .cover false }} noCover {{ end }}" alt="{{ .alt }}" src="{{ .url }}" />
{{ with .copyright }} {{ with .copyright }}
<div class="image-copyright">© {{ . }}</div> <div class="image-copyright">© {{ . }}</div>
{{ end }} {{ end }}
@ -67,9 +67,9 @@
<a href="{{.Permalink}}"> <a href="{{.Permalink}}">
<div class="author"> <div class="author">
{{ if .Params.image }} {{ if .Params.image }}
<img class="avatar-small" src="{{ .Params.image }}" alt="Avatar"> <img class="avatar-small" src="{{ .Params.image }}" alt="{{ .Params.name }} Avatar">
{{ else }} {{ else }}
<img class="avatar-small" src="{{ $.Site.Params.defaultimage }}" alt="Avatar"> <img class="avatar-small" src="{{ $.Site.Params.defaultimage }}" alt="Default Avatar">
{{ end }} {{ end }}
<h4 class="author-title">{{ .Params.name }}</h4> <h4 class="author-title">{{ .Params.name }}</h4>
<div class="social-media"> <div class="social-media">

View file

@ -12,9 +12,9 @@
<a href="{{.Permalink}}"> <a href="{{.Permalink}}">
<div class="teammember"> <div class="teammember">
{{ if .Params.image }} {{ if .Params.image }}
<img class="avatar" src="{{ .Params.image }}" alt="Avatar"> <img class="avatar" src="{{ .Params.image }}" alt="{{ .Params.name }} Avatar">
{{ else }} {{ else }}
<img class="avatar" src="{{ $.Site.Params.defaultimage }}" alt="Avatar"> <img class="avatar" src="{{ $.Site.Params.defaultimage }}" alt="Default Avatar">
{{ end }} {{ end }}
<h1 class="teammember-title">{{ .Params.name }}</h1> <h1 class="teammember-title">{{ .Params.name }}</h1>
{{- range .Params.jobs }} {{- range .Params.jobs }}

View file

@ -26,18 +26,20 @@
{{ with .Site.GetPage "/posts" }} {{ with .Site.GetPage "/posts" }}
{{- range .RegularPages -}} {{- range .RegularPages -}}
{{if eq .Params.author $name}} {{if eq .Params.author $name}}
<a href="{{.Permalink}}">
<div class="card"> <div class="card">
<a href="{{.Permalink}}">
<div class="cardContent">
{{ if .Params.image }} {{ if .Params.image }}
<img class="cardImage" src="{{ .Params.image }}" /> <img class="cardImage {{ if eq .Params.image.cover false }} noCover {{ end }}" alt="{{ .Params.image.alt }}" src="{{ .Params.image.url }}" />
{{ else }} {{ else }}
<img class="cardImage" src="{{ $defaultimage }}" /> <img class="cardImage" src="{{ .Site.Params.defaultimage }}" alt="Default Image" />
{{ end }} {{ end }}
<div class="cardTitle">{{.Title}}</div> <div class="cardTitle">{{.Title}}</div>
<div class="cardDescription">{{ .Content | safeHTML | truncate 250 }}</div> <div class="cardDescription">{{ .Content | safeHTML | truncate 250 }}</div>
<div class="cardDetail">{{.Date.Format "02.01.2006"}} | {{.ReadingTime}} Minuten</div> <div class="cardDetail">{{.Date.Format "02.01.2006"}} | {{.ReadingTime}} Minuten</div>
</div> </div>
</a> </a>
</div>
{{end}} {{end}}
{{ end }} {{ end }}
{{ end }} {{ end }}