Remove heading in figcaption when necessary

alternate-navbar
Maik de Kruif 3 years ago
parent fba2bd8805
commit a6d96dbdc2
Signed by: maik
GPG Key ID: 44A55AD1F0673FA6
  1. 6
      themes/maik-blog/assets/scss/_main.scss
  2. 14
      themes/maik-blog/layouts/shortcodes/figure.html

@ -182,8 +182,10 @@ figure {
}
figcaption {
font-size: 14px;
margin-top: 5px;
font-size: 1.125rem;
line-height: 1.3;
margin: 1.33em 0;
font-weight: bold;
opacity: 0.8;
&.left {

@ -14,17 +14,23 @@
{{- if .Get "link" }}</a>{{ end -}}
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
<figcaption>
{{ with (.Get "title") -}}
{{- if or (.Get "caption") (.Get "attr") -}}
{{- with (.Get "title") -}}
<h4>{{ . }}</h4>
{{- end -}}
{{- if or (.Get "caption") (.Get "attr") -}}<p>
<p>
{{- .Get "caption" | markdownify -}}
{{- with .Get "attrlink" }}
<a href="{{ . }}">
{{- end -}}
{{- .Get "attr" | markdownify -}}
{{- if .Get "attrlink" }}</a>{{ end }}</p>
{{- end }}
{{- if .Get "attrlink" }}</a>{{ end }}
</p>
{{- else -}}
{{- with (.Get "title") -}}
{{ . }}
{{- end -}}
{{- end -}}
</figcaption>
{{- end }}
</figure>
Loading…
Cancel
Save