diff --git a/layouts/partials/article-link/card-related.html b/layouts/partials/article-link/card-related.html index 6ea57ad8..b1fcb2ba 100644 --- a/layouts/partials/article-link/card-related.html +++ b/layouts/partials/article-link/card-related.html @@ -13,6 +13,10 @@ {{- $images := $.Resources.ByType "image" -}} {{- $featured := $images.GetMatch "*feature*" -}} {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} + {{ if and .Params.featureimage (not $featured) }} + {{- $url:= .Params.featureimage -}} + {{ $featured = resources.GetRemote $url }} + {{ end }} {{- if not $featured }}{{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}{{ end -}} {{- with $featured -}} {{ if $disableImageOptimization }} diff --git a/layouts/partials/article-link/card.html b/layouts/partials/article-link/card.html index f5eb8f54..53c9c768 100644 --- a/layouts/partials/article-link/card.html +++ b/layouts/partials/article-link/card.html @@ -13,6 +13,10 @@ {{- $images := $.Resources.ByType "image" -}} {{- $featured := $images.GetMatch "*feature*" -}} {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} + {{ if and .Params.featureimage (not $featured) }} + {{- $url:= .Params.featureimage -}} + {{ $featured = resources.GetRemote $url }} + {{ end }} {{- if not $featured }}{{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}{{ end -}} {{ if .Params.hideFeatureImage }}{{ $featured = false }}{{ end }} {{- with $featured -}} diff --git a/layouts/partials/article-link/simple.html b/layouts/partials/article-link/simple.html index bb1768ea..24bf281b 100644 --- a/layouts/partials/article-link/simple.html +++ b/layouts/partials/article-link/simple.html @@ -40,9 +40,9 @@ {{- $images := $.Resources.ByType "image" -}} {{- $featured := $images.GetMatch "*feature*" -}} {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} - {{ if .Params.featureimage }} + {{ if and .Params.featureimage (not $featured) }} {{- $url:= .Params.featureimage -}} - {{- if not $featured }}{{ $featured = resources.GetRemote $url }}{{ end -}} + {{ $featured = resources.GetRemote $url }} {{ end }} {{- if not $featured }}{{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}{{ end -}} {{ if .Params.hideFeatureImage }}{{ $featured = false }}{{ end }} diff --git a/layouts/partials/author-extra.html b/layouts/partials/author-extra.html index a15a63c1..701e9fa7 100644 --- a/layouts/partials/author-extra.html +++ b/layouts/partials/author-extra.html @@ -9,7 +9,7 @@ {{ else }} - {{ $authorImage := resources.GetRmeote . }} + {{ $authorImage := resources.GetRemote . }} {{ if not $disableImageOptimization }} {{ $authorImage = $authorImage.Fill "192x192" }} {{ end }} diff --git a/layouts/partials/hero/background.html b/layouts/partials/hero/background.html index f72015fe..ac4adb8a 100644 --- a/layouts/partials/hero/background.html +++ b/layouts/partials/hero/background.html @@ -4,10 +4,9 @@ {{- $featured := $images.GetMatch "*background*" -}} {{- if not $featured }}{{ $featured = $images.GetMatch "*feature*" }}{{ end -}} {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} -{{ if .Params.featureimage }} +{{ if and .Params.featureimage (not $featured) }} {{- $url:= .Params.featureimage -}} -{{if or $.Site.Params.list.showHero $.Site.Params.term.showHero $.Site.Params.taxonomy.showHero}} {{ $url = default $.Site.Params.homepage.homepageImage $.Site.Params.defaultBackgroundImage }} {{end}} -{{- if not $featured }}{{ $featured = resources.GetRemote $url }}{{ end -}} +{{ $featured = resources.GetRemote $url }} {{ end }} {{- if not $featured }}{{ with .Site.Params.defaultBackgroundImage }}{{ $featured = resources.Get . }}{{ end }}{{ end -}} {{ $isParentList := eq (.Scratch.Get "scope") "list" }} diff --git a/layouts/partials/home/background.html b/layouts/partials/home/background.html index 3ee48e58..00e43c59 100644 --- a/layouts/partials/home/background.html +++ b/layouts/partials/home/background.html @@ -6,9 +6,21 @@
{{ $homepageImage := "" }} - {{ with .Site.Params.defaultBackgroundImage }} {{ $homepageImage = resources.Get . }} {{if not $homepageImage}} {{ $homepageImage = resources.GetRemote . }} {{ end }} {{ end }} - {{ with .Site.Params.homepage.homepageImage }} {{ $homepageImage = resources.Get . }} {{if not $homepageImage}} {{ $homepageImage = resources.GetRemote . }} {{ end }} {{ end }} - {{ if not (eq $homepageImage "") }} + {{ with .Site.Params.defaultBackgroundImage }} + {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} + {{ $homepageImage = resources.GetRemote . }} + {{ else }} + {{ $homepageImage = resources.Get . }} + {{ end }} + {{ end }} + {{ with .Site.Params.homepage.homepageImage }} + {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} + {{ $homepageImage = resources.GetRemote . }} + {{ else }} + {{ $homepageImage = resources.Get . }} + {{ end }} + {{ end }} + {{ if $homepageImage }}
@@ -20,22 +32,19 @@
{{ with .Site.Author.image }} - {{ $authorImage := resources.Get . }} + {{ $authorImage := "" }} + {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} + {{ $authorImage = resources.GetRemote . }} + {{ else }} + {{ $authorImage = resources.Get . }} + {{ end }} {{ if $authorImage }} - {{ if not $disableImageOptimization }} - {{ $authorImage = $authorImage.Fill "288x288" }} - {{ end }} - {{ $.Site.Author.name | default - {{else}} - {{ $authorImage := resources.GetRemote . }} {{ if not $disableImageOptimization }} {{ $authorImage = $authorImage.Fill "288x288" }} {{ end }} {{ $.Site.Author.name | default {{ end }} - {{ end }}

{{ .Site.Author.name | default .Site.Title }} diff --git a/layouts/partials/home/card.html b/layouts/partials/home/card.html index 456a3526..0b17f839 100644 --- a/layouts/partials/home/card.html +++ b/layouts/partials/home/card.html @@ -15,8 +15,20 @@
{{ $homepageImage := "" }} - {{ with .Site.Params.defaultBackgroundImage }}{{ $homepageImage = resources.Get . }}{{ end }} - {{ with .Site.Params.homepage.homepageImage }}{{ $homepageImage = resources.Get . }}{{ end }} + {{ with .Site.Params.defaultBackgroundImage }} + {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} + {{ $homepageImage = resources.GetRemote . }} + {{ else }} + {{ $homepageImage = resources.Get . }} + {{ end }} + {{ end }} + {{ with .Site.Params.homepage.homepageImage }} + {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} + {{ $homepageImage = resources.GetRemote . }} + {{ else }} + {{ $homepageImage = resources.Get . }} + {{ end }} + {{ end }} {{ if $homepageImage }} diff --git a/layouts/partials/home/hero.html b/layouts/partials/home/hero.html index 91cb89fd..4ad3c58a 100644 --- a/layouts/partials/home/hero.html +++ b/layouts/partials/home/hero.html @@ -6,8 +6,20 @@
{{ $homepageImage := "" }} - {{ with .Site.Params.defaultBackgroundImage }}{{ $homepageImage = resources.Get . }}{{ end }} - {{ with .Site.Params.homepage.homepageImage }}{{ $homepageImage = resources.Get . }}{{ end }} + {{ with .Site.Params.defaultBackgroundImage }} + {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} + {{ $homepageImage = resources.GetRemote . }} + {{ else }} + {{ $homepageImage = resources.Get . }} + {{ end }} + {{ end }} + {{ with .Site.Params.homepage.homepageImage }} + {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} + {{ $homepageImage = resources.GetRemote . }} + {{ else }} + {{ $homepageImage = resources.Get . }} + {{ end }} + {{ end }} {{ if $homepageImage }}
{{ with .Site.Author.image }} - {{ $authorImage := resources.Get . }} - {{ if $authorImage }} - {{ if not $disableImageOptimization }} - {{ $authorImage = $authorImage.Fill "288x288" }} - {{ end }} - {{ $.Site.Author.name | default + {{ $authorImage := "" }} + {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} + {{ $authorImage = resources.GetRemote . }} {{ else }} - {{ $authorImage := resources.GetRemote . }} + {{ $authorImage = resources.Get . }} + {{ end }} + {{ if $authorImage }} {{ if not $disableImageOptimization }} {{ $authorImage = $authorImage.Fill "288x288" }} {{ end }} diff --git a/layouts/partials/home/profile.html b/layouts/partials/home/profile.html index 2a8a64bc..1780569e 100644 --- a/layouts/partials/home/profile.html +++ b/layouts/partials/home/profile.html @@ -1,44 +1,30 @@ {{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }} -
+ {{ end }} flex flex-col items-center justify-center text-center">
{{ with .Site.Author.image }} - {{ $authorImage := resources.Get . }} + {{ $authorImage := "" }} + {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} + {{ $authorImage = resources.GetRemote . }} + {{ else }} + {{ $authorImage = resources.Get . }} + {{ end }} {{ if $authorImage }} {{ if not $disableImageOptimization }} {{ $authorImage = $authorImage.Fill "288x288" }} {{ end }} - {{ $.Site.Author.name | default - {{ else }} - {{ $authorImage := resources.GetRemote . }} - {{ if not $disableImageOptimization }} - {{ $authorImage = $authorImage.Fill "288x288" }} - {{ end }} - {{ $.Site.Author.name | default + {{ $.Site.Author.name | default {{ end }} {{ end }}

{{ .Site.Author.name | default .Site.Title }}

{{ with .Site.Author.headline }} -

- {{ . | markdownify | emojify }} -

+

+ {{ . | markdownify | emojify }} +

{{ end }}
{{ partialCached "author-links.html" . }} @@ -48,4 +34,4 @@
{{ partial "recent-articles/main.html" . }} -
+ \ No newline at end of file