Compare commits

...

2 Commits

Author SHA1 Message Date
stereobooster 063600ed57
Merge bfae27980f into 1e90d7f077 2023-09-11 10:52:20 +02:00
stereobooster bfae27980f LQIP prototype 2023-09-11 10:52:03 +02:00
2 changed files with 12 additions and 0 deletions

View File

@ -9,6 +9,10 @@ This article offers a sample of basic Markdown formatting that can be used in Co
<!--more--> <!--more-->
## Image
![sample image](thumb-surendran-mp-IhWYiwSxm8g-unsplash.jpg)
## Headings ## Headings
The following HTML `<h1>`—`<h6>` elements represent six levels of section headings. `<h1>` is the highest section level while `<h6>` is the lowest. The following HTML `<h1>`—`<h6>` elements represent six levels of section headings. `<h1>` is the highest section level while `<h6>` is the lowest.

View File

@ -23,6 +23,11 @@
{{ end }} {{ end }}
{{ with $resource }} {{ with $resource }}
<figure> <figure>
{{ if ne .MediaType.SubType "svg" }}
{{ $lqip := .Resize "20x webp" }}
<div class="mx-auto my-0 rounded-md"
style="background: url(data:image/webp;base64,{{ $lqip.Content | base64Encode }}); background-size: cover">
{{ end }}
<img <img
class="mx-auto my-0 rounded-md" class="mx-auto my-0 rounded-md"
{{ if eq .MediaType.SubType "svg" }} {{ if eq .MediaType.SubType "svg" }}
@ -46,6 +51,9 @@
loading="lazy" loading="lazy"
{{ end }} {{ end }}
/> />
{{ if ne .MediaType.SubType "svg" }}
</div>
{{ end }}
{{ with $caption }}<figcaption class="text-center">{{ . | markdownify }}</figcaption>{{ end }} {{ with $caption }}<figcaption class="text-center">{{ . | markdownify }}</figcaption>{{ end }}
</figure> </figure>
{{ else }} {{ else }}