mirror of
				https://github.com/ItsDrike/itsdrike.com.git
				synced 2025-11-04 04:06:36 +00:00 
			
		
		
		
	Add render-image md render hook
This commit is contained in:
		
							parent
							
								
									1057d90287
								
							
						
					
					
						commit
						0283cec940
					
				
					 1 changed files with 14 additions and 0 deletions
				
			
		
							
								
								
									
										14
									
								
								layouts/_default/_markup/render-image.html
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								layouts/_default/_markup/render-image.html
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,14 @@
 | 
				
			||||||
 | 
					{{ $destination := .Destination }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{{ $resource := .Page.Resources.GetMatch $destination }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{{ if $resource }}
 | 
				
			||||||
 | 
					  {{ $destination = ($resource.Resize "1500x webp").RelPermalink }}
 | 
				
			||||||
 | 
					{{ end }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<figure class="text-center">
 | 
				
			||||||
 | 
					  <img src="{{ $destination | safeURL }}" alt="{{ .Text | plainify }}" style='max-width: {{ default "90" .Title }}%;' referrerpolicy="no-referrer" loading="lazy" decoding="async" />
 | 
				
			||||||
 | 
					  <figcaption class="text-center">
 | 
				
			||||||
 | 
					    <small>{{ .Text }}</small>
 | 
				
			||||||
 | 
					  </figcaption>
 | 
				
			||||||
 | 
					</figure>
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue