Update templates to use srcset
This commit is contained in:
parent
ff3567d3d0
commit
9264467bd0
5 changed files with 64 additions and 12 deletions
|
@ -15,10 +15,22 @@
|
|||
{% block content %}
|
||||
|
||||
<div uk-grid>
|
||||
|
||||
<div class="uk-width-1-1 uk-width-3-4@m">
|
||||
<div uk-lightbox >
|
||||
<a href="{{ photo.photo.url }}" data-alt="{{ photo.slug }}">
|
||||
<img src="{{ photo.photo.url }}" alt="{{ photo.slug }}" class="height='100%'" />
|
||||
<div uk-lightbox>
|
||||
<a href="{{ photo.photo_bg.url }}" data-alt="{{ photo.slug }}">
|
||||
<img
|
||||
src="{{ photo.photo_md.url }}"
|
||||
srcset="
|
||||
{{ photo.photo_sm.url }} 320w,
|
||||
{{ photo.photo_md.url }} 720w,
|
||||
{{ photo.photo_bg.url }} 1920w
|
||||
"
|
||||
sizes="(max-width: 640px) 320px,
|
||||
(max-width: 960px) 720px,
|
||||
1920px"
|
||||
alt="{{ photo.slug }}"
|
||||
style="max-width: 100%; max-height: 100vh; object-fit: contain;" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue