diff --git a/layouts/partials/article-list/compact.html b/layouts/partials/article-list/compact.html index 3988b83..dfcc276 100644 --- a/layouts/partials/article-list/compact.html +++ b/layouts/partials/article-list/compact.html @@ -12,13 +12,17 @@ - {{ if .Params.image }} - {{- $image := partial "helper/image" . -}} - {{- $thumbnail := $image.Fill "120x120" -}} + {{ $image := partial "helper/image" . }} -
- -
+ {{ if $image.exists }} +
+ {{ if $image.local }} + {{- $thumbnail := $image.src.Fill "120x120" -}} + + {{ else }} + Featured image of post {{ .Title }} + {{ end }} +
{{ end }} \ No newline at end of file diff --git a/layouts/partials/article-list/default.html b/layouts/partials/article-list/default.html index 25fcbc2..45f00d1 100644 --- a/layouts/partials/article-list/default.html +++ b/layouts/partials/article-list/default.html @@ -1,17 +1,22 @@
- {{ if .Params.image }} - {{- $image := partial "helper/image" . -}} - {{- $thumbnail := $image.Fill "800x250" -}} - {{- $thumbnailRetina := $image.Fill "1600x500" -}} + {{ $image := partial "helper/image" . }} -
- - Featured image of post {{ .Title }} - -
+ {{ if $image.exists }} +
+ + {{ if $image.local }} + {{- $thumbnail := $image.src.Fill "800x250" -}} + {{- $thumbnailRetina := $image.src.Fill "1600x500" -}} + + Featured image of post {{ .Title }} + {{ else }} + Featured image of post {{ .Title }} + {{ end }} + +
{{ end }} {{ partial "article/components/details" . }} diff --git a/layouts/partials/article-list/tile.html b/layouts/partials/article-list/tile.html index 9a58d4b..6b4375a 100644 --- a/layouts/partials/article-list/tile.html +++ b/layouts/partials/article-list/tile.html @@ -1,12 +1,19 @@ -
+{{ $image := partial "helper/image" .context }} +
- {{ if .context.Params.image }} - {{- $image := partial "helper/image" .context | resources.Fingerprint "md5" -}} - {{- $thumbnail := $image.Fill .size -}} -
- -
+ + {{ if $image.exists }} +
+ {{ if $image.local }} + {{- $imageRaw := $image.src | resources.Fingerprint "md5" -}} + {{- $thumbnail := $imageRaw.Fill .size -}} + + + {{ else }} + + {{ end }} +
{{ end }}
diff --git a/layouts/partials/article/components/details.html b/layouts/partials/article/components/details.html index 4349d61..0e3ff50 100644 --- a/layouts/partials/article/components/details.html +++ b/layouts/partials/article/components/details.html @@ -1,15 +1,14 @@ -{{ $i := .Params.image }} +{{ $image := partial "helper/image" . }} {{ $context := . }} -
{{ with $categories := .Params.categories }}