2023-09-23 23:54:17 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								{{- $alt := .PlainText | safeHTML -}}
							 | 
						
					
						
							
								
									
										
										
										
											2023-11-16 20:49:18 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								{{- $lazyLoading := .Page.Site.Params.enableImageLazyLoading | default true -}}
							 | 
						
					
						
							
								
									
										
										
										
											2023-09-23 23:54:17 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								{{- $dest := .Destination -}}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2023-11-16 20:49:18 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								{{- $isLocal := not (urls.Parse $dest).Scheme -}}
							 | 
						
					
						
							
								
									
										
										
										
											2023-09-23 23:54:17 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								{{- $isPage := and (eq .Page.Kind "page") (not .Page.BundleType) -}}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								{{- $startsWithSlash := hasPrefix $dest "/" -}}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								{{- $startsWithRelative := hasPrefix $dest "../" -}}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2023-11-16 20:49:18 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								{{- if and $dest $isLocal -}}
							 | 
						
					
						
							
								
									
										
										
										
											2023-09-23 23:54:17 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  {{- if $startsWithSlash -}}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    {{/* Images under static directory */}}
							 | 
						
					
						
							
								
									
										
										
										
											2023-09-24 11:03:34 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    {{- $dest = (relURL (strings.TrimPrefix "/" $dest)) -}}
							 | 
						
					
						
							
								
									
										
										
										
											2023-09-23 23:54:17 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  {{- else if and $isPage (not $startsWithRelative) -}}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    {{/* Images that are sibling to the individual page file */}}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    {{ $dest = (printf "../%s" $dest) }}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  {{- end -}}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								{{- end -}}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								{{- with .Title -}}
							 | 
						
					
						
							
								
									
										
										
										
											2023-08-19 13:42:59 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  <figure>
							 | 
						
					
						
							
								
									
										
										
										
											2023-09-23 23:54:17 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    <img src="{{ $dest | safeURL }}" title="{{ . }}" alt="{{ $alt }}" {{ if $lazyLoading }}loading="lazy"{{ end }} />
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    <figcaption>{{ . }}</figcaption>
							 | 
						
					
						
							
								
									
										
										
										
											2023-08-19 13:42:59 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  </figure>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								{{- else -}}
							 | 
						
					
						
							
								
									
										
										
										
											2023-09-23 23:54:17 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  <img src="{{ $dest | safeURL }}" alt="{{ $alt }}" {{ if $lazyLoading }}loading="lazy"{{ end }} />
							 | 
						
					
						
							
								
									
										
										
										
											2023-08-19 13:42:59 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								{{- end -}}
							 |