Add .figure class to code and image figures
This commit is contained in:
parent
830f22d6ba
commit
4da0aeca1a
2 changed files with 8 additions and 6 deletions
|
@ -1,4 +1,4 @@
|
|||
{{- $trimmedInner := trim .Inner "\n " -}}
|
||||
<figure class="code">
|
||||
<figure class="figure figure--code">
|
||||
{{ $.Page.RenderString $trimmedInner }}
|
||||
</figure>
|
||||
|
|
|
@ -17,16 +17,18 @@
|
|||
{{ errorf "No images found for name(s) parameter" }}
|
||||
{{- end -}}
|
||||
|
||||
<figure {{ with $class }}class="{{ . }}"{{ end }}>
|
||||
<div class=container>
|
||||
<figure class="figure figure--image{{ with $class }} {{ . }}{{ end }}">
|
||||
<div class="figure__container">
|
||||
{{ range $img := $imgs }}
|
||||
{{- $linkedImg := $img -}}
|
||||
{{ if not $img }}
|
||||
{{- if not $img }}
|
||||
{{ errorf "Found nil in images list for %s" $.Page.Permalink }}
|
||||
{{ end }}
|
||||
{{ end -}}
|
||||
|
||||
{{- if $shouldResize -}}
|
||||
{{ $linkedImg = $img.Fit "1280x1280" }}
|
||||
{{- end -}}
|
||||
|
||||
{{- $altText := $img.Params.alt | default $img.Title -}}
|
||||
<a href="{{ $img.RelPermalink }}">
|
||||
<img src="{{ $linkedImg.RelPermalink }}"
|
||||
|
@ -35,7 +37,7 @@
|
|||
</a>
|
||||
{{- end }}
|
||||
</div>
|
||||
{{ if and $shouldShowTitle -}}
|
||||
{{ if $shouldShowTitle -}}
|
||||
{{- range $imgs -}}
|
||||
{{- if gt (len .Title) 0 -}}
|
||||
<figcaption>{{ .Title }}</figcaption>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue