hugo: Display images a figures
This commit is contained in:
parent
564fcf8038
commit
988507af98
5 changed files with 34 additions and 13 deletions
15
layouts/_markup/render-image.html
Normal file
15
layouts/_markup/render-image.html
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{{- if .IsBlock -}}
|
||||
<figure>
|
||||
<img
|
||||
src="{{ .Destination | safeURL }}"
|
||||
{{- with .PlainText }}alt="{{ . }}"{{ end -}}
|
||||
/>
|
||||
{{- with .Title }}<figcaption>{{ . }}</figcaption>{{ end -}}
|
||||
</figure>
|
||||
{{- else -}}
|
||||
<img
|
||||
src="{{ .Destination | safeURL }}"
|
||||
{{- with .PlainText }}alt="{{ . }}"{{ end -}}
|
||||
{{- with .Title }}title="{{ . }}"{{ end -}}
|
||||
/>
|
||||
{{- end -}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue