mirror of
				https://github.com/Wonderfall/hugo-WonderMod.git
				synced 2025-10-30 19:35:26 +01:00 
			
		
		
		
	cover: responsive cover: generate responsive images only in "production" env
- will reduce render time in development env
This commit is contained in:
		| @@ -8,7 +8,8 @@ | ||||
|         {{- if $addLink }}<a href="{{ (path.Join .RelPermalink .Params.cover.image) | absURL }}" target="_blank">{{ end -}} | ||||
|         {{- $sizes := (slice "360" "480" "720" "1080" "1500") }} | ||||
|         {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") }} | ||||
|         {{- if (and (in $processableFormats $cover.MediaType.SubType) (ne .Site.Params.cover.responsiveImages false)) }} | ||||
|         {{- $prod := (eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production")) }} | ||||
|         {{- if (and (in $processableFormats $cover.MediaType.SubType) (ne .Site.Params.cover.responsiveImages false) (eq $prod true)) }} | ||||
|         <img srcset="{{- range $size := $sizes -}} | ||||
|                         {{- if (ge $cover.Width $size) -}} | ||||
|                         {{ printf "%s %s" (($cover.Resize (printf "%sx q100" $size)).Permalink) (printf "%sw ," $size) -}} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Aditya Telange
					Aditya Telange