Add a item template for photos in a grid
This commit is contained in:
		
							parent
							
								
									ae19e1a777
								
							
						
					
					
						commit
						454618222d
					
				
					 1 changed files with 10 additions and 0 deletions
				
			
		
							
								
								
									
										10
									
								
								layouts/photos/li_thumbnail_in_grid.html
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								layouts/photos/li_thumbnail_in_grid.html
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,10 @@
 | 
			
		|||
{{- $thumbnailResource := .Resources.GetMatch (index .Params "thumbnail")
 | 
			
		||||
                        | default (index (.Resources.ByType "image") 0) -}}
 | 
			
		||||
{{- $thumbnail := $thumbnailResource.Fit "600x600" -}}
 | 
			
		||||
{{- $thumbnail := $thumbnail.Crop "600x600" -}}
 | 
			
		||||
{{- $altText := $thumbnailResource.Params.alt -}}
 | 
			
		||||
<li>
 | 
			
		||||
    <a href="{{ .RelPermalink }}" title="{{ .Title }}">
 | 
			
		||||
        <img src="{{ $thumbnail.RelPermalink }}" {{ with $altText }}alt="{{ . }}"{{ end }}>
 | 
			
		||||
    </a>
 | 
			
		||||
</li>
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue