Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

Commit

Permalink
Merge pull request #249 from pacollins/patch-featured-transparent
Browse files Browse the repository at this point in the history
Fix removeBlur placement
  • Loading branch information
pacollins authored Apr 30, 2021
2 parents f1946b7 + 7389f5f commit 7e9ee84
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion layouts/_default/featured.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,29 @@
{{- $src := "" -}}
{{- $alt := "" -}}
{{- $stretch := .Site.Params.imageStretch -}}
{{- $blur := .Site.Params.removeBlur -}}
{{- if .Params.featured -}}
{{- $src = (path.Join "img" (cond (eq .Params.featuredpath "date") (.Page.Date.Format "2006/01") (.Params.featuredpath)) .Params.featured) | absURL -}}
{{- $alt = .Params.featuredalt -}}
{{- with .Params.featuredstretch -}}
{{- $stretch = . -}}
{{- end -}}
{{- with .Params.removeBlur -}}
{{- $blur = . -}}
{{- end -}}
{{- else if .Params.images -}}
{{- range first 1 .Params.images -}}
{{- $src = .src | absURL -}}
{{- $alt = .alt -}}
{{- with .stretch -}}
{{- $stretch = . -}}
{{- end -}}
{{- with .removeBlur -}}
{{- $blur = . -}}
{{- end -}}
{{- end -}}
{{- end -}}
<a href="{{ $.Page.RelPermalink }}" class="image"{{ if not (.Params.removeBlur | default .Site.Params.removeBlur) }} style="--bg-image: url('{{ $src }}');"{{ end }}>
<a href="{{ $.Page.RelPermalink }}" class="image"{{ if not ($blur) }} style="--bg-image: url('{{ $src }}');"{{ end }}>
<img {{ with $stretch }}class="{{ if or (eq (lower .) "vertical") (eq (lower .) "v") }}stretchV{{ else if or (eq (lower .) "horizontal") (eq (lower .) "h") }}stretchH{{ else if or (eq (lower .) "cover") (eq (lower .) "c") }}cover{{ end }}" {{ end }}src="{{ $src }}" alt="{{ $alt }}">
</a>
{{- end -}}

0 comments on commit 7e9ee84

Please sign in to comment.