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) }} {{ $featuredImage := .Resources.GetMatch (.Params.featured_image.src | safeURL) }}
{{ if $featuredImage }} {{ if $featuredImage }}
{{ $featuredImage = $featuredImage.Resize "600x" }} {{ $featuredImage = $featuredImage.Resize "600x" }}
<figure> <figure class="figure">
<img alt="" src="{{ $featuredImage.RelPermalink }}" /> <img class="figure-img img-fluid" alt="" src="{{ $featuredImage.RelPermalink }}" />
{{ with .Params.featured_image.caption }} {{ with .Params.featured_image.caption }}
<figcaption>{{ . }}</figcaption> <figcaption class="figure-caption">{{ . }}</figcaption>
{{ end }} {{ end }}
</figure> </figure>
{{ end }} {{ 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" -}} {{- if .Get "link" -}}
<a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}> <a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}>
{{- end -}} {{- end -}}
@ -9,10 +9,11 @@
{{- if or (.Get "alt") (.Get "caption") }} {{- if or (.Get "alt") (.Get "caption") }}
alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}" alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
{{- end -}} {{- end -}}
class="figure-img img-fluid rounded"
/><!-- Closing img tag --> /><!-- Closing img tag -->
{{- if .Get "link" }}</a>{{ end -}} {{- if .Get "link" }}</a>{{ end -}}
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}} {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
<figcaption> <figcaption class="figure-caption">
{{ with (.Get "title") -}} {{ with (.Get "title") -}}
<h4>{{ . }}</h4> <h4>{{ . }}</h4>
{{- end -}} {{- end -}}