diff --git a/CHANGELOG.md b/CHANGELOG.md index b2bf4516..34719d1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Added - Front matter support for specifying article thumbnails, covers and featured image details (including filename pattern, alt text and caption) +- Support for SVG assets as article thumbnails, covers and featured images - Front matter keywords support on a per article basis - Indonesian translation ([#398](https://github.com/jpanther/congo/pull/398)) - Mastodon sharing links ([#405](https://github.com/jpanther/congo/pull/405)) diff --git a/assets/css/compiled/main.css b/assets/css/compiled/main.css index f53854ab..08cb9bdb 100644 --- a/assets/css/compiled/main.css +++ b/assets/css/compiled/main.css @@ -1890,6 +1890,10 @@ body:has(#menu-controller:checked) { height: 9rem; } +.max-h-\[4\.5rem\] { + max-height: 4.5rem; +} + .max-h-\[10rem\] { max-height: 10rem; } @@ -1950,6 +1954,10 @@ body:has(#menu-controller:checked) { max-width: 65ch; } +.max-w-\[6rem\] { + max-width: 6rem; +} + .max-w-\[10rem\] { max-width: 10rem; } @@ -2883,6 +2891,10 @@ body:has(#menu-controller:checked) { display: none; } + .sm\:max-h-\[7\.5rem\] { + max-height: 7.5rem; + } + .sm\:w-1\/2 { width: 50%; } @@ -2891,6 +2903,10 @@ body:has(#menu-controller:checked) { width: 10rem; } + .sm\:max-w-\[10rem\] { + max-width: 10rem; + } + .sm\:flex-row { flex-direction: row; } diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index 63c27b73..81ec946e 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -17,15 +17,19 @@
{{ $altText }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 557f6995..3bb6ea80 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -17,12 +17,18 @@
{{ $.Params.featureAlt | default $.Params.coverAlt | default {{ with $.Params.coverCaption }} diff --git a/layouts/partials/article-link.html b/layouts/partials/article-link.html index 8c92bd49..d2907aed 100644 --- a/layouts/partials/article-link.html +++ b/layouts/partials/article-link.html @@ -13,12 +13,16 @@ aria-label="{{ $.Title | emojify }}" > {{ $.Params.featureAlt | default $.Params.thumbnailAlt | default
diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index 54cff269..58ff4fc2 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -21,15 +21,19 @@ {{ $resource = resources.Get ($url.String) }} {{ end }} {{ with $resource }} - {{ if or (lt .Width 660) (eq .MediaType.SubType "svg") }} + {{ if eq .MediaType.SubType "svg" }} src="{{ .RelPermalink }}" {{ else }} - srcset=" - {{ (.Resize "330x").RelPermalink }} 330w, - {{ (.Resize "660x").RelPermalink }} 660w, - {{ (.Resize "1024x").RelPermalink }} 1024w, - {{ (.Resize "1320x").RelPermalink }} 2x" - src="{{ (.Resize "660x").RelPermalink }}" + {{ if lt .Width 660 }} + src="{{ .RelPermalink }}" + {{ else }} + srcset=" + {{ (.Resize "330x").RelPermalink }} 330w, + {{ (.Resize "660x").RelPermalink }} 660w, + {{ (.Resize "1024x").RelPermalink }} 1024w, + {{ (.Resize "1320x").RelPermalink }} 2x" + src="{{ (.Resize "660x").RelPermalink }}" + {{ end }} {{ end }} {{ else }} src="{{ $url.String }}"