From bfae27980f39159963f0e470a2081485a5fa7648 Mon Sep 17 00:00:00 2001 From: stereobooster Date: Mon, 11 Sep 2023 10:07:09 +0200 Subject: [PATCH] LQIP prototype --- exampleSite/content/samples/markdown/index.md | 4 ++++ layouts/_default/_markup/render-image.html | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/exampleSite/content/samples/markdown/index.md b/exampleSite/content/samples/markdown/index.md index 601fae2a..d9f91110 100755 --- a/exampleSite/content/samples/markdown/index.md +++ b/exampleSite/content/samples/markdown/index.md @@ -9,6 +9,10 @@ This article offers a sample of basic Markdown formatting that can be used in Co +## Image + +![sample image](thumb-surendran-mp-IhWYiwSxm8g-unsplash.jpg) + ## Headings The following HTML `

`—`

` elements represent six levels of section headings. `

` is the highest section level while `

` is the lowest. diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index c1fe3634..892804e7 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -23,6 +23,11 @@ {{ end }} {{ with $resource }}
+ {{ if ne .MediaType.SubType "svg" }} + {{ $lqip := .Resize "20x webp" }} +
+ {{ end }} + {{ if ne .MediaType.SubType "svg" }} +
+ {{ end }} {{ with $caption }}
{{ . | markdownify }}
{{ end }}
{{ else }}