From 7d9ad73c0b43496c26325a426fb4ce551f4dc50b Mon Sep 17 00:00:00 2001 From: Gregory Trolliet Date: Sat, 27 Feb 2021 08:49:54 +0100 Subject: [PATCH 1/2] [THEME] Fix the half/third image width --- static/css/style.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/css/style.css b/static/css/style.css index 09abc16..bfe3b02 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -547,11 +547,11 @@ a:focus { } .article-body figure.half { width: 100%; - max-width: 50%; + max-width: 45%; } .article-body figure.third { width: 100%; - max-width: 33.33%; + max-width: 30%; } .article-body figure.logo img { width: 100px; From d35fec4c78101c4303b85f7b99fb6e5c251387da Mon Sep 17 00:00:00 2001 From: Gregory Trolliet Date: Sat, 27 Feb 2021 08:50:33 +0100 Subject: [PATCH 2/2] [SHORTCODE] Add picture/source to img --- layouts/shortcodes/img.html | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html index 9957c21..eef90e0 100644 --- a/layouts/shortcodes/img.html +++ b/layouts/shortcodes/img.html @@ -1,16 +1,27 @@ {{ $img := $.Page.Resources.GetMatch (.Get "src")}} +{{ $name_splitted := split $img.RelPermalink "." }} +{{ $name_base := index $name_splitted 0 }} +{{ $ext_base := index $name_splitted 1 }}
{{ with .Get "link" }} + {{ else }} + {{ end }} - {{ . }} - {{ with .Get "link" }} - - {{ end }} + + {{ if ( in "svg ico gif" $ext_base ) }} + {{ . }} + {{ else }} + + + {{ . }} + {{ end }} + + {{ if .Get "caption" }}

{{ .Get "caption" }}