mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-02-11 22:33:30 +08:00
add caption rendering
when render the image, also render the markdown caption
This commit is contained in:
parent
087989e427
commit
57263cb4d0
@ -1,6 +1,7 @@
|
||||
{{- $image := .Page.Resources.GetMatch (printf "%s" (.Destination | safeURL)) -}}
|
||||
{{- $Permalink := .Destination | relURL | safeURL -}}
|
||||
{{- $alt := .PlainText | safeHTML -}}
|
||||
{{- $title := .Title | safeHTML -}}
|
||||
{{- $Width := 0 -}}
|
||||
{{- $Height := 0 -}}
|
||||
{{- $Srcset := "" -}}
|
||||
@ -39,3 +40,6 @@
|
||||
data-flex-basis="{{ div (mul $image.Width 240) $image.Height }}px"
|
||||
{{ end }}
|
||||
>
|
||||
{{- if $title }}
|
||||
<figcaption>{{ .Title }}</figcaption>
|
||||
{{- end }}
|
||||
|
Loading…
Reference in New Issue
Block a user