mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-09 15:05:25 -04:00
Update image render hooks examples to conform with Commonmark
This commit is contained in:
parent
5391dddeac
commit
4429eeeea8
@ -91,7 +91,7 @@ In its default configuration, Hugo renders Markdown images according to the [Com
|
|||||||
|
|
||||||
{{< code file=layouts/_default/_markup/render-image.html copy=true >}}
|
{{< code file=layouts/_default/_markup/render-image.html copy=true >}}
|
||||||
<img src="{{ .Destination | safeURL }}"
|
<img src="{{ .Destination | safeURL }}"
|
||||||
{{- with .Text }} alt="{{ . }}"{{ end -}}
|
{{- with .PlainText }} alt="{{ . }}"{{ end -}}
|
||||||
{{- with .Title }} title="{{ . }}"{{ end -}}
|
{{- with .Title }} title="{{ . }}"{{ end -}}
|
||||||
>
|
>
|
||||||
{{- /* chomp trailing newline */ -}}
|
{{- /* chomp trailing newline */ -}}
|
||||||
@ -103,13 +103,13 @@ To render standalone images within `figure` elements:
|
|||||||
{{- if .IsBlock -}}
|
{{- if .IsBlock -}}
|
||||||
<figure>
|
<figure>
|
||||||
<img src="{{ .Destination | safeURL }}"
|
<img src="{{ .Destination | safeURL }}"
|
||||||
{{- with .Text }} alt="{{ . }}"{{ end -}}
|
{{- with .PlainText }} alt="{{ . }}"{{ end -}}
|
||||||
>
|
>
|
||||||
{{- with .Title }}<figcaption>{{ . }}</figcaption>{{ end -}}
|
{{- with .Title }}<figcaption>{{ . }}</figcaption>{{ end -}}
|
||||||
</figure>
|
</figure>
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
<img src="{{ .Destination | safeURL }}"
|
<img src="{{ .Destination | safeURL }}"
|
||||||
{{- with .Text }} alt="{{ . }}"{{ end -}}
|
{{- with .PlainText }} alt="{{ . }}"{{ end -}}
|
||||||
{{- with .Title }} title="{{ . }}"{{ end -}}
|
{{- with .Title }} title="{{ . }}"{{ end -}}
|
||||||
>
|
>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user