diff --git a/layouts/shortcodes/imgthumb.html b/layouts/shortcodes/imgthumb.html new file mode 100644 index 0000000..40aedee --- /dev/null +++ b/layouts/shortcodes/imgthumb.html @@ -0,0 +1,40 @@ +{{ $image := resources.GetMatch (.Get "src") }} +{{ $size := .Get "size" }} +{{/* Set the right options for Resize */}} +{{ $options := printf "%s %s %s" $size "jpg q90" "Box"}} +{{ $imagethumbnail := $image.Resize $options }} + + + + {{ with .Get + + {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}} +
+ {{ with (.Get "title") -}} +

{{ . }}

+ {{- end -}} + {{- if or (.Get "caption") (.Get "attr") -}}

+ {{- .Get "caption" | markdownify -}} + {{- with .Get "attrlink" }} + + {{- end -}} + {{- .Get "attr" | markdownify -}} + {{- if .Get "attrlink" }}{{ end }}

+ {{- end }} +
+ {{- end }} + + + {{ with .Get + +