Skip to content

Commit 6667cbc

Browse files
committed
Merge commit '81a7b6390036138356773c87a886679c81c524e1'
2 parents f36fc01 + 4429eee commit 6667cbc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

content/en/render-hooks/headings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ In its default configuration, Hugo renders Markdown headings according to the [C
6464
[CommonMark specification]: https://spec.commonmark.org/current/
6565

6666
{{< code file=layouts/_default/_markup/render-heading.html copy=true >}}
67-
<h{{ .Level }} id="{{ .Anchor }}">
67+
<h{{ .Level }} id="{{ .Anchor }}" {{- with .Attributes.class }} class="{{ . }}" {{- end }}>
6868
{{- .Text -}}
6969
</h{{ .Level }}>
7070
{{< /code >}}
7171

7272
To add an anchor link to the right of each heading:
7373

7474
{{< code file=layouts/_default/_markup/render-heading.html copy=true >}}
75-
<h{{ .Level }} id="{{ .Anchor }}">
75+
<h{{ .Level }} id="{{ .Anchor }}" {{- with .Attributes.class }} class="{{ . }}" {{- end }}>
7676
{{ .Text }}
7777
<a href="#{{ .Anchor }}">#</a>
7878
</h{{ .Level }}>

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)