mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 22:21:07 +03:00
Merge commit '81a7b63900
'
This commit is contained in:
commit
5c5508817f
2 changed files with 5 additions and 5 deletions
|
@ -64,7 +64,7 @@ In its default configuration, Hugo renders Markdown headings according to the [C
|
||||||
[CommonMark specification]: https://spec.commonmark.org/current/
|
[CommonMark specification]: https://spec.commonmark.org/current/
|
||||||
|
|
||||||
{{< code file=layouts/_default/_markup/render-heading.html copy=true >}}
|
{{< code file=layouts/_default/_markup/render-heading.html copy=true >}}
|
||||||
<h{{ .Level }} id="{{ .Anchor }}">
|
<h{{ .Level }} id="{{ .Anchor }}" {{- with .Attributes.class }} class="{{ . }}" {{- end }}>
|
||||||
{{- .Text -}}
|
{{- .Text -}}
|
||||||
</h{{ .Level }}>
|
</h{{ .Level }}>
|
||||||
{{< /code >}}
|
{{< /code >}}
|
||||||
|
@ -72,7 +72,7 @@ In its default configuration, Hugo renders Markdown headings according to the [C
|
||||||
To add an anchor link to the right of each heading:
|
To add an anchor link to the right of each heading:
|
||||||
|
|
||||||
{{< code file=layouts/_default/_markup/render-heading.html copy=true >}}
|
{{< code file=layouts/_default/_markup/render-heading.html copy=true >}}
|
||||||
<h{{ .Level }} id="{{ .Anchor }}">
|
<h{{ .Level }} id="{{ .Anchor }}" {{- with .Attributes.class }} class="{{ . }}" {{- end }}>
|
||||||
{{ .Text }}
|
{{ .Text }}
|
||||||
<a href="#{{ .Anchor }}">#</a>
|
<a href="#{{ .Anchor }}">#</a>
|
||||||
</h{{ .Level }}>
|
</h{{ .Level }}>
|
||||||
|
|
|
@ -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…
Add table
Add a link
Reference in a new issue