diff options
Diffstat (limited to 'layouts/shortcodes')
-rw-r--r-- | layouts/shortcodes/img-center.html | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/layouts/shortcodes/img-center.html b/layouts/shortcodes/img-center.html new file mode 100644 index 0000000..398cccc --- /dev/null +++ b/layouts/shortcodes/img-center.html @@ -0,0 +1,16 @@ +{{- $file := .Get 0 }} +{{- $path := printf "content_images/%s" $file}} +{{- $img := resources.Get $path }} +{{- $caption := .Get 1 }} +{{- $source := .Get 2 }} +{{- $img = $img.Resize "500x" }} +<figure> + <img class="centered" alt="{{ $caption }}" src="{{ $img.RelPermalink }}" width="{{ $img.Width }}" height="{{ $img.Height }}"> + <figcaption> + {{ $caption }} + + {{- if $source }} + <a href="{{ $source }}" target="_blank" title="source">[source]</a> + {{ end }} + </figcaption> +</figure> |