Embed the image of a photo post link in a <figure>
This commit is contained in:
		
							parent
							
								
									e65a680b49
								
							
						
					
					
						commit
						b72441b9b1
					
				
					 1 changed files with 6 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -1,9 +1,12 @@
 | 
			
		|||
{{- with $photoPage := $.Page.GetPage (printf "photos/%s" (.Get 0)) -}}
 | 
			
		||||
  {{- $thumbnail := partial "photos/thumbnail.html" (dict "Page" . "Width" 1280 "Height" 1280) -}}
 | 
			
		||||
  {{- $altText := $thumbnail.Params.alt | default .Title -}}
 | 
			
		||||
  <a class="to-photo-post" href="{{ .RelPermalink }}" title="{{ .Title }}">
 | 
			
		||||
    <img src="{{ $thumbnail.RelPermalink }}"{{ with $altText }} alt="{{ . }}"{{ end }}>
 | 
			
		||||
  </a>
 | 
			
		||||
  <figure class="figure  figure--image">
 | 
			
		||||
    <a class="to-photo-post" href="{{ .RelPermalink }}" title="{{ .Title }}">
 | 
			
		||||
      <img src="{{ $thumbnail.RelPermalink }}"{{ with $altText }} alt="{{ . }}"{{ end }}>
 | 
			
		||||
    </a>
 | 
			
		||||
    <figcaption>{{ .Title }}</figcaption>
 | 
			
		||||
  </figure>
 | 
			
		||||
{{- else -}}
 | 
			
		||||
  {{- errorf "No page matching '%s'" (.Get 0) -}}
 | 
			
		||||
{{- end -}}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue