From e77051ccc4b47951bfa4fde2be436b1bb2fb113b Mon Sep 17 00:00:00 2001 From: Christoph Cullmann Date: Sun, 28 Apr 2024 17:33:09 +0200 Subject: use https://github.com/nunocoracao/blowfish.git --- .../partials/article-link/card-related.html | 76 ++++++++++++++++ .../layouts/partials/article-link/card.html | 77 ++++++++++++++++ .../layouts/partials/article-link/simple.html | 101 +++++++++++++++++++++ 3 files changed, 254 insertions(+) create mode 100644 themes/blowfish/layouts/partials/article-link/card-related.html create mode 100644 themes/blowfish/layouts/partials/article-link/card.html create mode 100644 themes/blowfish/layouts/partials/article-link/simple.html (limited to 'themes/blowfish/layouts/partials/article-link') diff --git a/themes/blowfish/layouts/partials/article-link/card-related.html b/themes/blowfish/layouts/partials/article-link/card-related.html new file mode 100644 index 0000000..c7dbcc3 --- /dev/null +++ b/themes/blowfish/layouts/partials/article-link/card-related.html @@ -0,0 +1,76 @@ +{{ $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) }} + {{- $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")}} + {{ with . }} + + {{ end }} + {{ else }} + {{ with .Resize "600x" }} + + {{ end }} + {{ end }} + {{- 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" . }} +
+ + {{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }} +
+ {{ .Summary | emojify }} +
+ {{ end }} +
+
+ +
+
+
\ No newline at end of file diff --git a/themes/blowfish/layouts/partials/article-link/card.html b/themes/blowfish/layouts/partials/article-link/card.html new file mode 100644 index 0000000..dd2a788 --- /dev/null +++ b/themes/blowfish/layouts/partials/article-link/card.html @@ -0,0 +1,77 @@ +{{ $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) }} + {{- $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")}} + {{ with . }} +
+ {{ end }} + {{ else }} + {{ with .Resize "600x" }} +
+ {{ end }} + {{ end }} + {{- 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" . }} +
+ + {{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }} +
+ {{ .Summary | emojify }} +
+ {{ end }} +
+
+ +
+
+
\ No newline at end of file diff --git a/themes/blowfish/layouts/partials/article-link/simple.html b/themes/blowfish/layouts/partials/article-link/simple.html new file mode 100644 index 0000000..afee487 --- /dev/null +++ b/themes/blowfish/layouts/partials/article-link/simple.html @@ -0,0 +1,101 @@ +{{ $constrainItemsWidth := .Page.Site.Params.list.constrainItemsWidth | default false }} + +{{ $articleClasses := "flex flex-wrap article" }} +{{ if .Site.Params.list.showCards }} +{{ $articleClasses = delimit (slice $articleClasses "border border-neutral-200 dark:border-neutral-700 border-2 rounded-md overflow-hidden") " " }} +{{ else }} +{{ $articleClasses = delimit (slice $articleClasses "") " " }} +{{ end }} + +{{ $articleImageClasses := "w-full md:w-auto h-full thumbnail nozoom" }} +{{ if .Site.Params.list.showCards }} +{{ $articleImageClasses = delimit (slice $articleImageClasses "") " " }} +{{ else }} +{{ $articleImageClasses = delimit (slice $articleImageClasses "thumbnailshadow md:mr-7") " " }} +{{ end }} + +{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }} + +{{ $articleInnerClasses := "" }} +{{ if .Site.Params.list.showCards }} +{{ $articleInnerClasses = delimit (slice $articleInnerClasses "p-4") " " }} +{{ else }} +{{ $articleInnerClasses = delimit (slice $articleInnerClasses "mt-3 md:mt-0") " " }} +{{ end }} + +{{ if $constrainItemsWidth }} +{{ $articleClasses = delimit (slice $articleClasses "max-w-prose") " " }} +{{ end }} + + +{{ 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) }} + {{- $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")}} + {{ with . }} +
+ {{ end }} + {{ else }} + {{ with .Resize "600x" }} +
+ {{ end }} + {{ end }} + {{- else -}} + {{- with $.Site.Params.images }} + {{ end -}} + {{- end -}} + {{- end -}} + + +
+
+ {{ with .Params.externalUrl }} +
+
+ {{ $.Title | emojify }} + + + + +
+
+ {{ else }} +
{{ .Title | emojify }}
+ {{ end }} + {{ if and .Draft .Site.Params.article.showDraftLabel }} +
+ {{ 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" . }} +
+ {{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }} +
+ {{ .Summary | emojify }} +
+ {{ end }} +
+
\ No newline at end of file -- cgit v1.2.3