Parameterize the photo grid
This commit is contained in:
		
							parent
							
								
									864c1b673a
								
							
						
					
					
						commit
						8cc207b84c
					
				
					 8 changed files with 30 additions and 10 deletions
				
			
		| 
						 | 
				
			
			@ -1,5 +1,4 @@
 | 
			
		|||
{{ $stylesheets := slice (resources.Get "styles/root.css")
 | 
			
		||||
                         (resources.Get "styles/railroad.css")
 | 
			
		||||
{{ $stylesheets := slice (resources.Get "styles/railroad.css")
 | 
			
		||||
                         (resources.Get "styles/monokai.css")
 | 
			
		||||
                 | append (resources.Match "styles/root/*.css" | sort) }}
 | 
			
		||||
{{ if not hugo.IsProduction }}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,13 @@
 | 
			
		|||
{{- $thumbnail := partial "photos/thumbnail.html" (dict "Page" . "Width" 600 "Height" 600) -}}
 | 
			
		||||
{{- $thumbnail = $thumbnail.Crop "600x600" -}}
 | 
			
		||||
{{- $gridSize := $.Site.Params.photos.thumbnailSize -}}
 | 
			
		||||
{{- $thumbnail := partial "photos/thumbnail.html" (dict "Page" . "Width" $gridSize "Height" $gridSize) -}}
 | 
			
		||||
{{- $thumbnail = $thumbnail.Crop (printf "%dx%d" $gridSize $gridSize) -}}
 | 
			
		||||
{{- $altText := $thumbnail.Params.alt -}}
 | 
			
		||||
<a href="{{ .RelPermalink }}" title="{{ .Title }}">
 | 
			
		||||
  <img src="{{ $thumbnail.RelPermalink }}"{{ with $altText }} alt="{{ . }}"{{ end }}>
 | 
			
		||||
  <img
 | 
			
		||||
    src="{{ $thumbnail.RelPermalink }}"
 | 
			
		||||
    {{ with $altText }}
 | 
			
		||||
      alt="{{ . }}"
 | 
			
		||||
    {{ end }}
 | 
			
		||||
    width={{ $gridSize }}
 | 
			
		||||
    height={{ $gridSize }}>
 | 
			
		||||
</a>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,7 +11,12 @@
 | 
			
		|||
  {{ if eq (len $photos) 1 }}
 | 
			
		||||
    {{- $img := index $photos 0 -}}
 | 
			
		||||
    <figure>
 | 
			
		||||
      <img src="{{ $img.RelPermalink }}"{{ with $img.Params.alt }} alt="{{ . }}"{{ end }}>
 | 
			
		||||
      <img
 | 
			
		||||
        src="{{ $img.RelPermalink }}"
 | 
			
		||||
        {{ with $img.Params.alt }}
 | 
			
		||||
          alt="{{ . }}"
 | 
			
		||||
        {{ end }}
 | 
			
		||||
        height={{ $img.Height }}>
 | 
			
		||||
    </figure>
 | 
			
		||||
 | 
			
		||||
    <article>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue