generated from hbstack/template-mod
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: display the caption if present
Add the figure_class_name, figure_caption_class_name and figure_image_class_name parameters. For example, ![Alt](image.png "Caption").
- Loading branch information
Showing
4 changed files
with
56 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{{- partial "images/image" (dict | ||
"Filename" .Destination | ||
"Alt" .Text | ||
"Caption" .Title | ||
"Page" .Page) | ||
-}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<picture{{ with .wrapperClass }} class="{{ . }}"{{ end }}> | ||
{{- range .sources }} | ||
<source srcset="{{ .srcset }}" type="{{ .type }}" /> | ||
{{- end }} | ||
<img | ||
class="{{ .className }}" | ||
src="{{ .src }}" | ||
alt="{{ .alt }}" | ||
{{ if .lazyLoading }}loading="lazy"{{ end }} | ||
{{ with .naturalHeight }}height="{{ . }}"{{ end }} | ||
{{ with .naturalWidth }}width="{{ . }}"{{ end }} | ||
{{ with .style }}{{ printf `style="%s"` (delimit . `; `) | safeHTMLAttr }}{{ end }} | ||
{{ if and .original .originalSrc }}data-src="{{ .originalSrc }}"{{ end }} | ||
{{ if and .original .originalWidth }}data-width="{{ .originalWidth }}"{{ end }} | ||
{{ if and .original .originalHeight }}data-height="{{ .originalHeight }}"{{ end }} /> | ||
</picture> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters