Skip to content

Commit a91908c

Browse files
authored
Optimize the image on the subscribe page (#1247)
* optimize image on the subscribe page * mobile files, fix
1 parent 4287340 commit a91908c

File tree

8 files changed

+25
-70
lines changed

8 files changed

+25
-70
lines changed

qdrant-landing/content/subscribe/_index.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ section_title: Subscribe
44
subtitle: Subscribe
55
description: Subscribe
66
image:
7-
src: /img/subscribe.svg
8-
srcMobile: /img/mobile/subscribe.svg
7+
src: /img/subscribe.webp
8+
srcMobile: /img/mobile/subscribe.webp
9+
# always add png image to the same folder as webp image for compatibility with older browsers
910
alt: Astronaut
1011
form:
1112
title: Sign up for Qdrant Updates

qdrant-landing/themes/qdrant-2024/layouts/partials/subscribe.html

+22-4
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,37 @@ <h5 class="subscribe-block__title">{{ .Params.form.title }}</h5>
1212
<!-- </form>-->
1313

1414
{{ with (.Site.GetPage "/headless/newsletter") }}
15-
{{ partial "hubspot-form.html" (dict "hubspotFormOptions" .Params.hubspotFormOptions "id" "subscribe-page" "context" . "classes" "subscribe-block__hs-form") }}
15+
{{ partial "hubspot-form.html" (dict "hubspotFormOptions" .Params.hubspotFormOptions "id" "subscribe-page" "context" . "classes" "subscribe-block__hs-form") }}
1616
{{ end }}
1717
</div>
1818
</div>
19-
<img class="subscribe-body__image" src="{{ .Params.image.src }}" alt="{{ .Params.image.alt }}" />
20-
<img class="subscribe-body__image-mobile" src="{{ .Params.image.srcMobile }}" alt="{{ .Params.image.alt }}" />
19+
<picture>
20+
<source srcset="{{ .Params.image.src }}" type="image/png" />
21+
<img
22+
class="subscribe-body__image"
23+
src="{{ .Params.image.src | replaceRE "\\.[^.]+$" ".png" }} "
24+
alt="{{ .Params.image.alt }}"
25+
loading="lazy"
26+
/>
27+
</picture>
28+
<picture>
29+
<source srcset="{{ .Params.image.srcMobile }}" type="image/png" />
30+
<img
31+
class="subscribe-body__image-mobile"
32+
src="{{ .Params.image.srcMobile | replaceRE "\\.[^.]+$" ".png" }}"
33+
alt="{{ .Params.image.alt }}"
34+
loading="lazy"
35+
/>
36+
</picture>
2137
</div>
2238
<div class="subscribe-header">
2339
<p class="subscribe-header__rights">{{ .Params.footer.rights | safeHTML }}</p>
2440
<a class="subscribe-header__link" href="{{ .Params.footer.termsLink.url }}">{{ .Params.footer.termsLink.text }}</a>
2541
<a class="subscribe-header__link" href="{{ .Params.footer.policyLink.url }}">
2642
{{ .Params.footer.policyLink.text }}
2743
</a>
28-
<a class="subscribe-header__link" href="{{ .Params.footer.impressumLink.url }}">{{ .Params.footer.impressumLink.text }}</a>
44+
<a class="subscribe-header__link" href="{{ .Params.footer.impressumLink.url }}"
45+
>{{ .Params.footer.impressumLink.text }}</a
46+
>
2947
</div>
3048
</section>
Loading

qdrant-landing/themes/qdrant-2024/static/img/mobile/subscribe.svg

-42
This file was deleted.
Binary file not shown.
Loading

qdrant-landing/themes/qdrant-2024/static/img/subscribe.svg

-22
This file was deleted.
Binary file not shown.

0 commit comments

Comments
 (0)