small fixes

This commit is contained in:
teldra 2022-04-06 21:20:16 +02:00
parent 18ad44e5e2
commit 9fdd7448e9
2 changed files with 17 additions and 11 deletions

View File

@ -118,7 +118,7 @@ article {
}
#articletext img {
margin: 1.5rem 1.5rem 3rem 2rem;
border-radius: 15px;
width: 80%;
}

View File

@ -1,13 +1,17 @@
{{- if strings.HasPrefix .Destination "http" -}}
<img loading="lazy"
src="{{ .Destination | safeURL }}"
alt="{{ .Text }}"
{{ with .Title}} title="{{ . }}"{{ end }} />
<a href="{{- .Destination -}}">
<img loading="lazy"
src="{{ .Destination | safeURL }}"
alt="{{ .Text }}"
{{ with .Title}} title="{{ . }}"{{ end }} />
<div style="display: flex; justify-content: center;">{{ .Text }}</div>
</a>
{{- else -}}
{{ if .Page.Resources.ByType "image" }}
{{ $nr := .Destination }}
{{- $pic := index (.Page.Resources.ByType "image") (int $nr) -}}
{{- $image := .Page.Resources.GetMatch (printf "%s" ($pic | safeURL)) -}}
<div>
<a href="{{- $image.Permalink -}}">
{{- $permalink := "" -}}
@ -18,12 +22,14 @@
{{- $permalink = (printf "/%s" (.Destination | safeURL)) -}}
{{- end -}}
<img loading="lazy"
src="{{ $permalink }}"
alt="{{ .Text }}"
{{ with .Title}} title="{{ . }}"{{ end }}
width={{ $image.Width }}
height="{{ $image.Height }}" />
<div style="display: flex; justify-content: center;"><img loading="lazy"
src="{{ $permalink }}"
alt="{{ .Text }}"
{{ with .Title}} title="{{ . }}"{{ end }}
width={{ $image.Width }}
height="{{ $image.Height }}" /></div>
<div style="display: flex; justify-content: center;">{{ .Text }}</div>
</a>
</div>
{{ end }}
{{- end -}}