diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html index 9792dd3..436feb6 100644 --- a/layouts/shortcodes/img.html +++ b/layouts/shortcodes/img.html @@ -1,42 +1,51 @@ -{{ $source := ($.Page.Resources.ByType "image").GetMatch (printf "%s" (.Get "name")) }} -{{ $customAlt := .Get "alt" }} -{{ $customSize := .Get "size" }} -{{ $lazyLoad := default (default true $.Site.Params.GeekblogImageLazyLoading) (.Get "lazy") }} +{{- $source := ($.Page.Resources.ByType "image").GetMatch (printf "%s" (.Get "name")) }} +{{- $customAlt := .Get "alt" }} +{{- $customSize := .Get "size" | lower }} +{{- $lazyLoad := default (default true $.Site.Params.GeekblogImageLazyLoading) (.Get "lazy") }} -{{ with $source }} - {{ $caption := default .Title $customAlt }} +{{- with $source }} + {{- $caption := default .Title $customAlt }} - {{ $tiny := (.Resize "320x").Permalink }} - {{ $small := (.Resize "600x").Permalink }} - {{ $medium := (.Resize "1200x").Permalink }} - {{ $large := (.Resize "1800x").Permalink }} + {{- $profile := (.Fill "180x180 Center").Permalink }} + {{- $tiny := (.Resize "320x").Permalink }} + {{- $small := (.Resize "600x").Permalink }} + {{- $medium := (.Resize "1200x").Permalink }} + {{- $large := (.Resize "1800x").Permalink }} - {{ $size := dict "tiny" $tiny "small" $small "medium" $medium "large" $large }} + {{- $size := dict "profile" $profile "tiny" $tiny "small" $small "medium" $medium "large" $large }}
-
+
{{ $caption }} - {{ with $caption }} -
- {{ . }}{{ with $source.Params.credits }} ({{ . | $.Page.RenderString }}){{ end }} -
- {{ end }} + {{- if not (eq $customSize "profile") }} + {{- with $caption }} +
+ {{ . }} + {{- with $source.Params.credits }} + {{ printf " (%s)" . | $.Page.RenderString }} + {{- end }} +
+ {{- end }} + {{- end }}
-{{ end }} +{{- end }} diff --git a/src/sass/_base.scss b/src/sass/_base.scss index 8ed90c1..0da5684 100644 --- a/src/sass/_base.scss +++ b/src/sass/_base.scss @@ -428,6 +428,11 @@ svg.gblog-icon { border-top-left-radius: $border-radius; border-top-right-radius: $border-radius; + &--round, + &--round img { + border-radius: 50% !important; + } + figcaption { display: table-caption; caption-side: bottom;