diff options
| author | Sivaldo <git@sivaldodavi.com> | 2026-06-29 18:36:52 -0300 |
|---|---|---|
| committer | Sivaldo <git@sivaldodavi.com> | 2026-06-29 18:36:52 -0300 |
| commit | dd7670cf72b27c1b330d3732a483ca22e3a3db18 (patch) | |
| tree | 16d4e458d93cd7181d4ebc950ed406b45038f53b /layouts/shortcodes/img.html | |
Commit inicial
Diffstat (limited to 'layouts/shortcodes/img.html')
| -rw-r--r-- | layouts/shortcodes/img.html | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html new file mode 100644 index 0000000..40002cf --- /dev/null +++ b/layouts/shortcodes/img.html @@ -0,0 +1,34 @@ +<!-- + class: class of figure + link: url of image + id: id of image + alt: alt text + caption: caption + mouse: text when moused over + width: fixed width (ex: 600px, 80%) + maxwidth: max width (ex: 800px) +--> + +<figure {{ with .Get "class" }}class="{{.}}"{{ end -}}> + {{- with .Get "link"}}<a href="{{.}}">{{ end -}} + <img + src="{{ .Get "src" }}" + {{- with .Get "mouse" }} title="{{.}}"{{ end -}} + {{- with .Get "id" }} id="{{.}}"{{ end -}} + {{- with .Get "alt" }} alt="{{.}}"{{ end -}} + {{- if or (.Get "width") (.Get "maxwidth") }} + style=" + {{- with .Get "width" }}width: {{.}};{{ end -}} + {{- with .Get "maxwidth" }}max-width: {{.}};{{ end -}} + height: auto; + " + {{- end -}} + > + {{- if .Get "link"}}</a>{{ end -}} + + {{- with .Get "caption" -}} + <figcaption> + {{- . -}} + </figcaption> + {{- end -}} +</figure> |
