Allow for credits in image positions

This commit is contained in:
Christian Wolf 2024-08-09 15:46:18 +02:00
parent bd1076113f
commit acbd51bcd7
3 changed files with 18 additions and 4 deletions

View File

@ -760,6 +760,13 @@ h1 {
}
}
.tsc-image, .tsc-gallery-img {
.credits {
font-style: italic;
float: right;
}
}
.youtube-video {
max-width: 100%;
}

View File

@ -24,4 +24,10 @@
src="{{ $img.RelPermalink }}"
>
</a>
{{ with .Get "credits" }}
<div class="credits">Foto: {{ . }}</div>
{{ end }}
{{ with .Get "caption" }}
<caption>{{ . }}</caption>
{{ end }}
</figure>

View File

@ -1,4 +1,4 @@
<figure class="tsc-image">
<figure class="tsc-image" style="{{- with .Get "width" -}}max-width: min(90%, {{.}}px);{{- end -}}">
{{ with .Get "href" }}
<a href="{{ . }}">
{{ end }}
@ -7,16 +7,17 @@
{{- $filename := .Get "src" }}
{{ $resource := .Page.Resources.Get $filename -}}
src="{{ $resource.RelPermalink }}"
style="
{{- with .Get "width" -}}max-width: min(90%, {{.}}px);{{- end -}}
"
>
{{ with .Get "href" }}
</a>
{{ end }}
{{ with .Get "credits" }}
<div class="credits">Foto: {{ . }}</div>
{{ end }}
{{ with .Get "caption" }}
<figcaption>
{{ . }}
</figcaption>
{{ end }}
</figure>