fix(style): add bootstrap class to figure
All checks were successful
Deploy workflow / deploy (push) Successful in 13s

This commit is contained in:
Matthieu Bessat 2024-08-31 21:37:26 +02:00
parent a77c74bc70
commit f9e49913bf
2 changed files with 6 additions and 5 deletions

View file

@ -17,10 +17,10 @@
{{ $featuredImage := .Resources.GetMatch (.Params.featured_image.src | safeURL) }}
{{ if $featuredImage }}
{{ $featuredImage = $featuredImage.Resize "600x" }}
<figure>
<img alt="" src="{{ $featuredImage.RelPermalink }}" />
<figure class="figure">
<img class="figure-img img-fluid" alt="" src="{{ $featuredImage.RelPermalink }}" />
{{ with .Params.featured_image.caption }}
<figcaption>{{ . }}</figcaption>
<figcaption class="figure-caption">{{ . }}</figcaption>
{{ end }}
</figure>
{{ end }}

View file

@ -1,4 +1,4 @@
<figure class="fig-img {{ with .Get "class" }}{{ . }}{{ end }}">
<figure class="figure fig-img {{ with .Get "class" }}{{ . }}{{ end }}">
{{- if .Get "link" -}}
<a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}>
{{- end -}}
@ -9,10 +9,11 @@
{{- if or (.Get "alt") (.Get "caption") }}
alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
{{- end -}}
class="figure-img img-fluid rounded"
/><!-- Closing img tag -->
{{- if .Get "link" }}</a>{{ end -}}
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
<figcaption>
<figcaption class="figure-caption">
{{ with (.Get "title") -}}
<h4>{{ . }}</h4>
{{- end -}}