MAke it possible to set empty alt attribute on figure, img and svg shortcodes. Do not use h4 for caption title in figure, use strong instead.
This commit is contained in:
parent
d2efd1ae4f
commit
dc538ae451
4 changed files with 4 additions and 5 deletions
|
|
@ -175,7 +175,6 @@ figure {
|
|||
caption-side: bottom;
|
||||
}
|
||||
|
||||
h4,
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,11 +87,11 @@
|
|||
|
||||
<figure class="image{{ with $class }} {{ . }}{{ end }}">
|
||||
{{ with $link }}<a href="{{ . }}">{{ end -}}
|
||||
<img src="{{ $src }}"{{ with $srcsetw }} srcset="{{ delimit . ", " }}"{{ end }}{{ with $alt }} alt="{{ . }}"{{ end }}{{ with $width }} width="{{ . }}"{{ end }}{{ with $height }} height="{{ . }}"{{ end }}>
|
||||
<img src="{{ $src }}"{{ with $srcsetw }} srcset="{{ delimit . ", " }}"{{ end }}{{ if isset .Params "alt" }} alt="{{ $alt }}"{{ end }}{{ with $width }} width="{{ . }}"{{ end }}{{ with $height }} height="{{ . }}"{{ end }}>
|
||||
{{- if $link }}</a>{{ end }}
|
||||
{{ if or $title $caption $attr -}}
|
||||
<figcaption>
|
||||
{{ with $title }}<h4>{{ . }}</h4>{{ end -}}
|
||||
{{ with $title }}<strong>{{ . }}</strong><br>{{ end -}}
|
||||
{{- $caption | markdownify }}{{ if and $caption $attr }} {{ end -}}
|
||||
{{ with $attrlink }}<a href="{{ . }}">{{ end }}{{ $attr | markdownify }}{{ if $attrlink }}</a>{{ end -}}
|
||||
</figcaption>
|
||||
|
|
|
|||
|
|
@ -82,5 +82,5 @@
|
|||
{{ end -}}
|
||||
|
||||
{{ with $link }}<a class="image-link" href="{{ . }}">{{ end -}}
|
||||
<img class="image{{ with $class }} {{ . }}{{ end }}" src="{{ $src }}"{{ with $srcsetw }} srcset="{{ delimit . ", " }}"{{ end }}{{ with $alt }} alt="{{ . }}"{{ end }}{{ with $width }} width="{{ . }}"{{ end }}{{ with $height }} height="{{ . }}"{{ end }}>
|
||||
<img class="image{{ with $class }} {{ . }}{{ end }}" src="{{ $src }}"{{ with $srcsetw }} srcset="{{ delimit . ", " }}"{{ end }}{{ if isset .Params "alt" }} alt="{{ $alt }}"{{ end }}{{ with $width }} width="{{ . }}"{{ end }}{{ with $height }} height="{{ . }}"{{ end }}>
|
||||
{{- if $link }}</a>{{ end }}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
{{ if $inline -}}
|
||||
<div class="image image--svg{{ with $class }} {{ . }}{{ end }}">{{ $src | safeHTML }}</div>
|
||||
{{ else -}}
|
||||
<img class="image image--svg{{ with $class }} {{ . }}{{ end }}" src="{{ $src }}"{{ with $alt }} alt="{{ . }}"{{ end }}{{ with $width }} width="{{ . }}"{{ end }}{{ with $height }} height="{{ . }}"{{ end }}>
|
||||
<img class="image image--svg{{ with $class }} {{ . }}{{ end }}" src="{{ $src }}"{{ if isset .Params "alt" }} alt="{{ $alt }}"{{ end }}{{ with $width }} width="{{ . }}"{{ end }}{{ with $height }} height="{{ . }}"{{ end }}>
|
||||
{{ end -}}
|
||||
{{- if $link }}</a>{{ end }}
|
||||
{{ if $caption -}}
|
||||
|
|
|
|||
Loading…
Reference in a new issue