From 24ad4ae339c9ebc76a2b35bde67555408eb2d706 Mon Sep 17 00:00:00 2001 From: Henk Verlinde Date: Fri, 14 Jan 2022 13:32:51 +0100 Subject: [PATCH] feat: drop image shortcodes for markdown image support --- layouts/shortcodes/img-simple.html | 7 ------- layouts/shortcodes/img.html | 27 --------------------------- 2 files changed, 34 deletions(-) delete mode 100644 layouts/shortcodes/img-simple.html delete mode 100644 layouts/shortcodes/img.html diff --git a/layouts/shortcodes/img-simple.html b/layouts/shortcodes/img-simple.html deleted file mode 100644 index 117bc81..0000000 --- a/layouts/shortcodes/img-simple.html +++ /dev/null @@ -1,7 +0,0 @@ -{{ $image := .Page.Resources.GetMatch (printf "*%s*" (.Get "src")) -}} -{{ $lqip := $image.Resize $.Site.Params.lqipWidth -}} -{{ if eq .Site.Params.options.lazySizes true -}} - -{{ else -}} - -{{ end -}} \ No newline at end of file diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html deleted file mode 100644 index 51a6a9d..0000000 --- a/layouts/shortcodes/img.html +++ /dev/null @@ -1,27 +0,0 @@ -{{ $image := .Page.Resources.GetMatch (printf "*%s*" (.Get "src")) -}} -{{ $lqip := $image.Resize $.Site.Params.lqipWidth -}} - -{{ $imgSrc := "" -}} -{{ $imgSrcSet := slice -}} - -{{ $widths := $.Site.Params.landscapePhotoWidths -}} -{{ if gt $image.Height $image.Width -}} - {{ $widths = $.Site.Params.portraitPhotoWidths -}} -{{ end -}} - -{{ range $widths -}} - {{ $srcUrl := (printf "%dx" . | $image.Resize).Permalink -}} - {{ if eq $imgSrc "" -}}{{ $imgSrc = $srcUrl -}}{{ end -}} - {{ $imgSrcSet = $imgSrcSet | append (printf "%s %dw" $srcUrl .) -}} -{{ end -}} -{{ $imgSrcSet = (delimit $imgSrcSet ",") -}} - - - {{ if eq .Site.Params.options.lazySizes true -}} - - {{ else -}} - - {{ end -}} - - {{ with .Get "caption" }}
{{ . | safeHTML }}
{{ end }} -