diff --git a/layouts/partials/article-link/card-related.html b/layouts/partials/article-link/card-related.html index 288a85de..c7c49b01 100644 --- a/layouts/partials/article-link/card-related.html +++ b/layouts/partials/article-link/card-related.html @@ -1,78 +1,70 @@ {{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }} -{{ with .Params.externalUrl }} - - {{ else }} - - {{ end }} -
- - {{- with $.Params.images -}} - {{- range first 6 . }} - {{ end -}} - {{- else -}} - {{- $images := $.Resources.ByType "image" -}} - {{- $featured := $images.GetMatch "*feature*" -}} - {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} - {{ if and .Params.featureimage (not $featured) }} +
+ + {{- with $.Params.images -}} + {{- range first 6 . }} + + {{ end -}} + {{- else -}} + {{- $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 or $disableImageOptimization (strings.HasSuffix $featured ".svg")}} + {{ end }} + {{- if not $featured }} + {{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }} + {{ end -}} + {{- with $featured -}} + {{ if or $disableImageOptimization (strings.HasSuffix $featured ".svg") }} {{ with . }} - + {{ end }} {{ else }} {{ with .Resize "600x" }} - + {{ end }} {{ end }} - {{- else -}} + {{- else -}} {{- with $.Site.Params.images }} - {{ end -}} - {{- end -}} - {{- end -}} - - - {{ if and .Draft .Site.Params.article.showDraftLabel }} - - {{ partial "badge.html" (i18n "article.draft" | emojify) }} - - {{ end }} - - -
- {{ with .Params.externalUrl }} -
-
- {{ $.Title | emojify }} - - - - -
-
- {{ else }} -
- {{ .Title | emojify }} -
- {{ end }} - - -
- {{ partial "article-meta/basic.html" . }} + + {{ end -}} + {{- end -}} + {{- end -}} + {{ if and .Draft .Site.Params.article.showDraftLabel }} + + {{ partial "badge.html" (i18n "article.draft" | emojify) }} + + {{ end }} +
+ {{ with .Params.externalUrl }} +
+ {{ $.Title | emojify }} + + + +
- - {{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }} -
- {{ .Summary | plainify }} -
- {{ end }} -
-
+ {{ else }} +
+ {{ .Title | emojify }} +
+ {{ end }} +
{{ partial "article-meta/basic.html" . }}
+ {{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }} +
{{ .Summary | plainify }}
+ {{ end }}
- +
+
diff --git a/layouts/partials/article-link/card.html b/layouts/partials/article-link/card.html index 7a565d3c..91bacda6 100644 --- a/layouts/partials/article-link/card.html +++ b/layouts/partials/article-link/card.html @@ -1,78 +1,67 @@ {{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }} -{{ with .Params.externalUrl }} - - {{ else }} - - {{ end }} -
- - {{- with $.Params.images -}} - {{- range first 6 . }} - {{ end -}} - {{- else -}} - {{- $images := $.Resources.ByType "image" -}} - {{- $featured := $images.GetMatch "*feature*" -}} - {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} - {{ if and .Params.featureimage (not $featured) }} +
+ + {{- with $.Params.images -}} + {{- range first 6 . }} + + {{ end -}} + {{- else -}} + {{- $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 -}} - {{ if or $disableImageOptimization (strings.HasSuffix $featured ".svg")}} + {{ end }} + {{- if not $featured }} + {{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }} + {{ end -}} + {{ if .Params.hideFeatureImage }}{{ $featured = false }}{{ end }} + {{- with $featured -}} + {{ if or $disableImageOptimization (strings.HasSuffix $featured ".svg") }} {{ with . }} -
+
{{ end }} {{ else }} {{ with .Resize "600x" }} -
+
{{ end }} {{ end }} - {{- else -}} + {{- else -}} {{- with $.Site.Params.images }} - {{ end -}} - {{- end -}} - {{- end -}} - - {{ if and .Draft .Site.Params.article.showDraftLabel }} - - {{ partial "badge.html" (i18n "article.draft" | emojify) }} - - {{ end }} - - -
- {{ with .Params.externalUrl }} -
-
- {{ $.Title | emojify }} - - - - -
-
- {{ else }} -
- {{ .Title | emojify }} -
- {{ end }} - - -
- {{ partial "article-meta/basic.html" . }} + + {{ end -}} + {{- end -}} + {{- end -}} + {{ if and .Draft .Site.Params.article.showDraftLabel }} + + {{ partial "badge.html" (i18n "article.draft" | emojify) }} + + {{ end }} +
+ {{ with .Params.externalUrl }} +
+ {{ $.Title | emojify }} + + + +
- - {{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }} -
- {{ .Summary | plainify }} -
- {{ end }} -
-
+ {{ else }} +
+ {{ .Title | emojify }} +
+ {{ end }} +
{{ partial "article-meta/basic.html" . }}
+ {{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }} +
{{ .Summary | plainify }}
+ {{ end }}
- +
+
diff --git a/layouts/partials/article-link/simple.html b/layouts/partials/article-link/simple.html index bf5461fc..43b49835 100644 --- a/layouts/partials/article-link/simple.html +++ b/layouts/partials/article-link/simple.html @@ -1,6 +1,6 @@ {{ $constrainItemsWidth := .Page.Site.Params.list.constrainItemsWidth | default false }} -{{ $articleClasses := "flex flex-wrap md:flex-nowrap article" }} +{{ $articleClasses := "flex flex-wrap md:flex-nowrap article relative" }} {{ if .Site.Params.list.showCards }} {{ $articleClasses = delimit (slice $articleClasses "border border-neutral-200 dark:border-neutral-700 border-2 rounded-md overflow-hidden") " " }} {{ else }} @@ -28,73 +28,73 @@ {{ end }} - +
+ {{- with $.Params.images -}} {{- range first 6 . }} - {{ end -}} - {{- else -}} + + {{ end -}} + {{- else -}} {{- $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 }} + {{- $url:= .Params.featureimage -}} + {{ $featured = resources.GetRemote $url }} {{ end }} - {{- if not $featured }}{{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}{{ end -}} + {{- if not $featured }} + {{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }} + {{ end -}} {{ if .Params.hideFeatureImage }}{{ $featured = false }}{{ end }} {{- with $featured -}} - {{ if or $disableImageOptimization (strings.HasSuffix $featured ".svg")}} + {{ if or $disableImageOptimization (strings.HasSuffix $featured ".svg") }} {{ with . }} -
+
{{ end }} {{ else }} - {{ with .Resize "600x" }} -
+ {{ with .Resize "600x" }} +
{{ end }} {{ end }} {{- else -}} - {{- with $.Site.Params.images }} - {{ end -}} - {{- end -}} + {{- with $.Site.Params.images }} + + {{ end -}} {{- end -}} + {{- end -}}
{{ with .Params.externalUrl }} -
-
- {{ $.Title | emojify }} - - - - -
+
+ {{ $.Title | emojify }} + + + +
{{ else }}
+ class="decoration-primary-500 dark:text-neutral text-xl font-bold text-neutral-800 hover:underline hover:underline-offset-2"> {{ .Title | emojify }}
{{ end }} {{ if and .Draft .Site.Params.article.showDraftLabel }} -
- {{ partial "badge.html" (i18n "article.draft" | emojify) }} -
+
{{ partial "badge.html" (i18n "article.draft" | emojify) }}
{{ end }} {{ if templates.Exists "partials/extend-article-link.html" }} {{ partial "extend-article-link.html" . }} {{ end }}
-
- {{ partial "article-meta/basic.html" . }} -
+
{{ partial "article-meta/basic.html" . }}
{{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }} -
- {{ .Summary | plainify }} -
+
{{ .Summary | plainify }}
{{ end }}
- +
+
diff --git a/layouts/partials/article-meta/basic.html b/layouts/partials/article-meta/basic.html index ed6fb5f3..15ef16d9 100644 --- a/layouts/partials/article-meta/basic.html +++ b/layouts/partials/article-meta/basic.html @@ -82,9 +82,7 @@ {{ if (gt (len ($context.GetTerms $taxonomy)) 0) }} {{ range $i, $a := $context.GetTerms $taxonomy }} {{ if not (eq $i 0) }}, {{ end }} -
- {{ $a.LinkTitle }} -
+ {{ $a.LinkTitle }} {{ end }} {{ end }} {{ end }} @@ -99,11 +97,9 @@ {{ if and (not (eq $taxonomy "authors")) (not (eq $taxonomy "series")) }} {{ if (gt (len ($context.GetTerms $taxonomy)) 0) }} {{ range $context.GetTerms $taxonomy }} - - {{ partial "badge.html" .LinkTitle }} - + {{ partial "badge.html" .LinkTitle }} {{ end }} {{ end }} {{ end }} @@ -115,9 +111,9 @@ {{ if .Params.showCategoryOnly | default (.Site.Params.article.showCategoryOnly | default false) }}
{{ range (.GetTerms "categories") }} - - {{ partial "badge.html" .LinkTitle }} - + {{ partial "badge.html" .LinkTitle }} {{ end }}
{{ end }}