| 
									
										
										
										
											2023-09-23 23:54:17 +01:00
										 |  |  | {{- $alt := .PlainText | safeHTML -}} | 
					
						
							|  |  |  | {{- $lazyLoading := .Page.Site.Params.enableImagelazyLoading | default true -}} | 
					
						
							|  |  |  | {{- $dest := .Destination -}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | {{- $isRemote := not (urls.Parse $dest).Scheme -}} | 
					
						
							|  |  |  | {{- $isPage := and (eq .Page.Kind "page") (not .Page.BundleType) -}} | 
					
						
							|  |  |  | {{- $startsWithSlash := hasPrefix $dest "/" -}} | 
					
						
							|  |  |  | {{- $startsWithRelative := hasPrefix $dest "../" -}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | {{- if and $dest $isRemote -}} | 
					
						
							|  |  |  |   {{- 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 -}} |