mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 10:18:40 +00:00
Merge commit '81a7b6390036138356773c87a886679c81c524e1'
This commit is contained in:
commit
6667cbcd88
2 files changed
+5
-5
No files matched your search
@@ -64,7 +64,7 @@ In its default configuration, Hugo renders Markdown headings according to the [C
|
||||
[CommonMark specification]: https://spec.commonmark.org/current/
|
||||
|
||||
{{< code file=layouts/_default/_markup/render-heading.html copy=true >}}
|
||||
<h{{ .Level }} id="{{ .Anchor }}">
|
||||
<h{{ .Level }} id="{{ .Anchor }}" {{- with .Attributes.class }} class="{{ . }}" {{- end }}>
|
||||
{{- .Text -}}
|
||||
</h{{ .Level }}>
|
||||
{{< /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:
|
||||
|
||||
{{< code file=layouts/_default/_markup/render-heading.html copy=true >}}
|
||||
<h{{ .Level }} id="{{ .Anchor }}">
|
||||
<h{{ .Level }} id="{{ .Anchor }}" {{- with .Attributes.class }} class="{{ . }}" {{- end }}>
|
||||
{{ .Text }}
|
||||
<a href="#{{ .Anchor }}">#</a>
|
||||
</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 >}}
|
||||
<img src="{{ .Destination | safeURL }}"
|
||||
{{- with .Text }} alt="{{ . }}"{{ end -}}
|
||||
{{- with .PlainText }} alt="{{ . }}"{{ end -}}
|
||||
{{- with .Title }} title="{{ . }}"{{ end -}}
|
||||
>
|
||||
{{- /* chomp trailing newline */ -}}
|
||||
@@ -103,13 +103,13 @@ To render standalone images within `figure` elements:
|
||||
{{- if .IsBlock -}}
|
||||
<figure>
|
||||
<img src="{{ .Destination | safeURL }}"
|
||||
{{- with .Text }} alt="{{ . }}"{{ end -}}
|
||||
{{- with .PlainText }} alt="{{ . }}"{{ end -}}
|
||||
>
|
||||
{{- with .Title }}<figcaption>{{ . }}</figcaption>{{ end -}}
|
||||
</figure>
|
||||
{{- else -}}
|
||||
<img src="{{ .Destination | safeURL }}"
|
||||
{{- with .Text }} alt="{{ . }}"{{ end -}}
|
||||
{{- with .PlainText }} alt="{{ . }}"{{ end -}}
|
||||
{{- with .Title }} title="{{ . }}"{{ end -}}
|
||||
>
|
||||
{{- end -}}
|
||||
|
||||
Reference in new issue
Block a user