mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 16:31:52 +01:00
fix(article-link): skip fetching images when hideFeatureImage is true
This commit is contained in:
@@ -32,9 +32,10 @@
|
||||
{{ $articleClasses = delimit (slice $articleClasses "max-w-prose") " " }}
|
||||
{{ end }}
|
||||
|
||||
{{ $images := $target.Resources.ByType "image" }}
|
||||
{{ $featured := "" }}
|
||||
{{ $featuredURL := "" }}
|
||||
{{ if not .Params.hideFeatureImage }}
|
||||
{{ $images := $target.Resources.ByType "image" }}
|
||||
{{ range slice "*feature*" "*cover*" "*thumbnail*" }}
|
||||
{{ if not $featured }}{{ $featured = $images.GetMatch . }}{{ end }}
|
||||
{{ end }}
|
||||
@@ -45,13 +46,13 @@
|
||||
{{ if not $featured }}
|
||||
{{ with site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}
|
||||
{{ end }}
|
||||
{{ if $target.Params.hideFeatureImage }}{{ $featured = false }}{{ end }}
|
||||
{{ with $featured }}
|
||||
{{ $featuredURL = .RelPermalink }}
|
||||
{{ if not (or $disableImageOptimization (eq .MediaType.SubType "svg")) }}
|
||||
{{ $featuredURL = (.Resize "600x").RelPermalink }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<div class="{{ $articleClasses }}">
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
*/}}
|
||||
{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }}
|
||||
|
||||
{{ $images := $.Resources.ByType "image" }}
|
||||
{{ $featured := "" }}
|
||||
{{ $featuredURL := "" }}
|
||||
{{ $images := $.Resources.ByType "image" }}
|
||||
{{ range slice "*feature*" "*cover*" "*thumbnail*" }}
|
||||
{{ if not $featured }}{{ $featured = $images.GetMatch . }}{{ end }}
|
||||
{{ end }}
|
||||
@@ -14,7 +14,7 @@
|
||||
{{ $featured = resources.GetRemote $url }}
|
||||
{{ end }}
|
||||
{{ if not $featured }}
|
||||
{{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}
|
||||
{{ with site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}
|
||||
{{ end }}
|
||||
{{ with $featured }}
|
||||
{{ $featuredURL = .RelPermalink }}
|
||||
|
||||
@@ -5,9 +5,10 @@
|
||||
*/}}
|
||||
{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }}
|
||||
|
||||
{{ $images := $.Resources.ByType "image" }}
|
||||
{{ $featured := "" }}
|
||||
{{ $featuredURL := "" }}
|
||||
{{ if not .Params.hideFeatureImage }}
|
||||
{{ $images := $.Resources.ByType "image" }}
|
||||
{{ range slice "*feature*" "*cover*" "*thumbnail*" }}
|
||||
{{ if not $featured }}{{ $featured = $images.GetMatch . }}{{ end }}
|
||||
{{ end }}
|
||||
@@ -18,13 +19,13 @@
|
||||
{{ if not $featured }}
|
||||
{{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}
|
||||
{{ end }}
|
||||
{{ if .Params.hideFeatureImage }}{{ $featured = false }}{{ end }}
|
||||
{{ with $featured }}
|
||||
{{ $featuredURL = .RelPermalink }}
|
||||
{{ if not (or $disableImageOptimization (eq .MediaType.SubType "svg")) }}
|
||||
{{ $featuredURL = (.Resize "600x").RelPermalink }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<div
|
||||
|
||||
@@ -32,9 +32,10 @@
|
||||
{{ $articleClasses = delimit (slice $articleClasses "max-w-prose") " " }}
|
||||
{{ end }}
|
||||
|
||||
{{ $images := $.Resources.ByType "image" }}
|
||||
{{ $featured := "" }}
|
||||
{{ $featuredURL := "" }}
|
||||
{{ if not .Params.hideFeatureImage }}
|
||||
{{ $images := $.Resources.ByType "image" }}
|
||||
{{ range slice "*feature*" "*cover*" "*thumbnail*" }}
|
||||
{{ if not $featured }}{{ $featured = $images.GetMatch . }}{{ end }}
|
||||
{{ end }}
|
||||
@@ -45,13 +46,13 @@
|
||||
{{ if not $featured }}
|
||||
{{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}
|
||||
{{ end }}
|
||||
{{ if .Params.hideFeatureImage }}{{ $featured = false }}{{ end }}
|
||||
{{ with $featured }}
|
||||
{{ $featuredURL = .RelPermalink }}
|
||||
{{ if not (or $disableImageOptimization (eq .MediaType.SubType "svg")) }}
|
||||
{{ $featuredURL = (.Resize "600x").RelPermalink }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<div class="{{ $articleClasses }}">
|
||||
|
||||
Reference in New Issue
Block a user