- Move photo_thumbnail.html to photos/thumbnail.html - Add a photos/list.html partial that returns a list of photos for the current page - Use the template above everywhere we need a list of photos for the page
		
			
				
	
	
		
			45 lines
		
	
	
	
		
			1 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			45 lines
		
	
	
	
		
			1 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
{{ define "header" }}
 | 
						|
  {{ partial "header.html" . }}
 | 
						|
{{ end }}
 | 
						|
 | 
						|
{{ define "main" }}
 | 
						|
{{- if .Title -}}
 | 
						|
  {{ partial "content_header.html" . }}
 | 
						|
{{- end -}}
 | 
						|
 | 
						|
{{- $photos := partial "photos/list.html" . -}}
 | 
						|
{{ if eq (len $photos) 0 }}
 | 
						|
  {{ errorf "Missing photo from photos page %q" .Path }}
 | 
						|
{{ end }}
 | 
						|
 | 
						|
{{ if eq (len $photos) 1 }}
 | 
						|
  {{- $img := index $photos 0 -}}
 | 
						|
  <figure><img src="{{ $img.RelPermalink }}"{{ with $img.Params.alt }} alt="{{ . }}"{{ end }}></figure>
 | 
						|
 | 
						|
  {{ .Content }}
 | 
						|
 | 
						|
  {{- if .Params.photo_details | default true -}}
 | 
						|
    {{- partial "photo_exif_table.html" $img.Exif -}}
 | 
						|
 | 
						|
    {{- if in ($.Site.BaseURL | string) "localhost" -}}
 | 
						|
      {{- partial "development/photo_exif_table.html" $img.Exif -}}
 | 
						|
    {{- end -}}
 | 
						|
  {{- end -}}
 | 
						|
{{ else }}
 | 
						|
  <figure>
 | 
						|
    <ul class="carousel">
 | 
						|
      {{- range $photos -}}
 | 
						|
        <li>{{ . }}</li>
 | 
						|
      {{- end -}}
 | 
						|
    </ul>
 | 
						|
  </figure>
 | 
						|
{{ end }}
 | 
						|
 | 
						|
<footer>
 | 
						|
  {{ partial "footer_tags.html" . }}
 | 
						|
</footer>
 | 
						|
{{ end }}
 | 
						|
 | 
						|
{{ define "footer" }}
 | 
						|
  {{ partial "footer.html" . }}
 | 
						|
{{ end }}
 |