Alexander Avery
3 years ago
7 changed files with 36 additions and 9 deletions
@ -1,10 +1,23 @@ |
|||
{{ if resources.Get .context.Params.featured.url }} |
|||
<img class="{{ .class | default "fill-wh"}}" |
|||
{{ with resources.Get .context.url }} |
|||
{{ with resources.Get .context.Params.featured.url }} |
|||
srcset=" |
|||
{{ (.Resize "320x q30").RelPermalink }} 320w, |
|||
{{ (.Resize "600x q40").RelPermalink }} 600w, |
|||
{{ (.Resize "1200x q65").RelPermalink }} 2x" |
|||
src="{{ .RelPermalink }}" |
|||
{{ end }} |
|||
alt="{{ .context.alt }}" |
|||
alt="{{ .context.Params.featured.alt }}" |
|||
/> |
|||
{{ else }} |
|||
<img class="{{ .class | default "fill-wh"}}" |
|||
{{ with .context.Resources.GetMatch .context.Params.featured.url }} |
|||
srcset=" |
|||
{{ (.Resize "320x q30").RelPermalink }} 320w, |
|||
{{ (.Resize "600x q40").RelPermalink }} 600w, |
|||
{{ (.Resize "1200x q65").RelPermalink }} 2x" |
|||
src="{{ .RelPermalink }}" |
|||
alt="{{ .Params.alt }}" |
|||
{{ end }} |
|||
/> |
|||
{{ end }} |
|||
|
Loading…
Reference in new issue