Update layout to use Hugo Image Processing.
Created shortcode rimg that uses the srcset attribute to display responsive images.
This commit is contained in:
parent
da036923f3
commit
3a77d4c703
10 changed files with 218 additions and 20 deletions
|
@ -1,5 +1,15 @@
|
|||
{{ $heroImage:= "/assets/images/default-hero.jpg"}}
|
||||
{{ if .Params.hero }}
|
||||
{{ $heroImage = .Params.hero }}
|
||||
{{ $heroImage := .Page.Resources.GetMatch "hero.{jpg,png}"}}
|
||||
{{ .Scratch.Set "heroScratch" $heroImage }}
|
||||
|
||||
{{ if not $heroImage }}
|
||||
|
||||
{{ $heroImage:= resources.Get "default-hero.jpg"}}
|
||||
{{ .Scratch.Set "heroScratch" $heroImage }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
{{ $heroImage := .Scratch.Get "heroScratch" }}
|
||||
{{ if $heroImage }}
|
||||
{{ $heroImage := $heroImage.Resize "148x" }}
|
||||
{{ return $heroImage.RelPermalink }}
|
||||
{{ end }}
|
||||
{{ return $heroImage }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue