Skip to content

Commit 4429eee

Browse files
authored
Update image render hooks examples to conform with Commonmark
1 parent 5391ddd commit 4429eee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

content/en/render-hooks/images.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ In its default configuration, Hugo renders Markdown images according to the [Com
9191

9292
{{< code file=layouts/_default/_markup/render-image.html copy=true >}}
9393
<img src="{{ .Destination | safeURL }}"
94-
{{- with .Text }} alt="{{ . }}"{{ end -}}
94+
{{- with .PlainText }} alt="{{ . }}"{{ end -}}
9595
{{- with .Title }} title="{{ . }}"{{ end -}}
9696
>
9797
{{- /* chomp trailing newline */ -}}
@@ -103,13 +103,13 @@ To render standalone images within `figure` elements:
103103
{{- if .IsBlock -}}
104104
<figure>
105105
<img src="{{ .Destination | safeURL }}"
106-
{{- with .Text }} alt="{{ . }}"{{ end -}}
106+
{{- with .PlainText }} alt="{{ . }}"{{ end -}}
107107
>
108108
{{- with .Title }}<figcaption>{{ . }}</figcaption>{{ end -}}
109109
</figure>
110110
{{- else -}}
111111
<img src="{{ .Destination | safeURL }}"
112-
{{- with .Text }} alt="{{ . }}"{{ end -}}
112+
{{- with .PlainText }} alt="{{ . }}"{{ end -}}
113113
{{- with .Title }} title="{{ . }}"{{ end -}}
114114
>
115115
{{- end -}}

0 commit comments

Comments
 (0)