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 { .youtube-video {
max-width: 100%; max-width: 100%;
} }

View File

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