File tree Expand file tree Collapse file tree 1 file changed +25
-13
lines changed
Expand file tree Collapse file tree 1 file changed +25
-13
lines changed Original file line number Diff line number Diff line change 22
33{% block extra_head %}
44< style >
5- .food-image {
5+ .food-image-container {
66 margin-top : 1rem ;
7- width : auto;
8- max-width : 100% ;
9- height : auto;
7+ width : 100% ;
8+ height : 0 ;
9+ padding-bottom : 56.25% ; /* 16:9 aspect ratio (9/16 = 0.5625) */
10+ position : relative;
11+ background-color : # ffffff ;
12+ }
13+ .food-image {
14+ position : absolute;
15+ top : 0 ;
16+ left : 0 ;
17+ width : 100% ;
18+ height : 100% ;
19+ object-fit : cover;
1020}
1121.sampling-date {
1222 font-style : italic;
@@ -141,15 +151,17 @@ <h1 class="name">{{ name }}</h1>
141151 < p > < b class ="sgfi "> Something Going For It</ b > </ p >
142152 {% endif %}
143153 {% if food_image_path %}
144- < picture >
145- {% if food_image_path.endswith('.webp') %}
146- < source srcset ="{{ food_image_path }} " type ="image/webp ">
147- < source srcset ="{{ food_image_path.replace('.webp', '.jpg') }} " type ="image/jpeg ">
148- < img src ="{{ food_image_path.replace('.webp', '.jpg') }} " alt ="{{ alt_text }} " class ="food-image " loading ="lazy " width ="800 " height ="450 ">
149- {% else %}
150- < img src ="{{ food_image_path }} " alt ="{{ alt_text }} " class ="food-image " loading ="lazy " width ="800 " height ="450 ">
151- {% endif %}
152- </ picture >
154+ < div class ="food-image-container ">
155+ < picture >
156+ {% if food_image_path.endswith('.webp') %}
157+ < source srcset ="{{ food_image_path }} " type ="image/webp ">
158+ < source srcset ="{{ food_image_path.replace('.webp', '.jpg') }} " type ="image/jpeg ">
159+ < img src ="{{ food_image_path.replace('.webp', '.jpg') }} " alt ="{{ alt_text }} " class ="food-image " loading ="lazy " width ="1200 " height ="675 ">
160+ {% else %}
161+ < img src ="{{ food_image_path }} " alt ="{{ alt_text }} " class ="food-image " loading ="lazy " width ="1200 " height ="675 ">
162+ {% endif %}
163+ </ picture >
164+ </ div >
153165 {% endif %}
154166 < h3 class ="notes "> Remarks</ h3 >
155167 {{ content }}
You can’t perform that action at this time.
0 commit comments