Move a bunch of shortcodes and partials back from the platters theme
This commit is contained in:
		
							parent
							
								
									20d53e0df2
								
							
						
					
					
						commit
						3102dc1e56
					
				
					 29 changed files with 1 additions and 1 deletions
				
			
		
							
								
								
									
										21
									
								
								layouts/shortcodes/img.html
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								layouts/shortcodes/img.html
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,21 @@
 | 
			
		|||
{{ $img := dict }}
 | 
			
		||||
{{ with .Get "name" }}
 | 
			
		||||
    {{ $img = $.Page.Resources.GetMatch . }}
 | 
			
		||||
{{ else }}
 | 
			
		||||
    {{ errorf "No name given to img shortcode" }}
 | 
			
		||||
{{ end }}
 | 
			
		||||
 | 
			
		||||
{{/* Space separated list of classes to apply to the <img> tag */}}
 | 
			
		||||
{{ $classes := .Get "class" }}
 | 
			
		||||
 | 
			
		||||
{{ $altText := .Get "alt" | default $img.Params.alt }}
 | 
			
		||||
{{ if not $altText }}
 | 
			
		||||
    {{ warnf "Image doesn't have alt text: %s" $img.RelPermalink }}
 | 
			
		||||
{{ end }}
 | 
			
		||||
 | 
			
		||||
{{ $resizedImg := $img.Fit "1280x1280" }}
 | 
			
		||||
<img src="{{ $resizedImg.RelPermalink }}"
 | 
			
		||||
     width="{{ $resizedImg.Width }}"
 | 
			
		||||
     height="{{ $resizedImg.Height }}"
 | 
			
		||||
     alt="{{ $altText }}"
 | 
			
		||||
     {{ with $classes }}class="{{ . }}"{{ end }}>
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue