aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/card-feed.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/default/layouts/partials/card-feed.html')
-rw-r--r--themes/default/layouts/partials/card-feed.html82
1 files changed, 82 insertions, 0 deletions
diff --git a/themes/default/layouts/partials/card-feed.html b/themes/default/layouts/partials/card-feed.html
new file mode 100644
index 0000000..fbcab8c
--- /dev/null
+++ b/themes/default/layouts/partials/card-feed.html
@@ -0,0 +1,82 @@
+<micro-card>
+ <micro-summary>
+ <micro-thumbnail>
+
+ {{- $imageCanonicalURL := (print "https://" .FeedSourceDomain "/favicon.ico") -}}
+ {{- $imageTitle := "No image found" -}}
+ {{- $imageSource := "/images/404.png" -}}
+
+ {{- with $image := resources.GetRemote $imageCanonicalURL -}}
+ {{- with .Err -}}
+ {{ warnf "%s" . }}
+ {{- $fallbackImage := imageConfig (print "static/images/404.png") -}}
+ {{- with $fallbackImage -}}
+ {{- $fallbackWidth := .Width -}}
+ {{- $fallbackHeight := .Height -}}
+ {{ end }}
+ {{- else -}}
+ {{- $imageTitle = $imageCanonicalURL -}}
+ {{- $imageSource = $image.RelPermalink -}}
+ {{ end }}
+ <figure>
+ <a title="{{ $imageTitle }}" href=" {{ $imageSource }}">
+ <picture>
+ <img alt="" src="{{ $imageSource }}" />
+ </picture>
+ </a>
+ </figure>
+ {{ else }}
+ <figure>
+ <a title="{{ $imageTitle }}" href=" {{ $imageSource }}">
+ <picture>
+ <img alt="" src="{{ $imageSource }}" />
+ </picture>
+ </a>
+ </figure>
+ {{ end }}
+
+ </micro-thumbnail>
+
+ <micro-content>
+ <micro-metadata>
+ <micro-thumbnail hidden>
+ <figure>
+ <a title="{{ $imageTitle }}" href=" {{ $imageSource }}">
+ <picture>
+ <img alt="" src="{{ $imageSource }}" />
+ </picture>
+ </a>
+ </figure>
+ </micro-thumbnail>
+ <section>
+ <b>{{ .FeedName }}</b>
+
+ &middot; <a
+ title="{{ .FeedSourceLink }}"
+ rel="noopener"
+ target="_blank"
+ href="{{ .FeedSourceLink }}">
+ @{{ .FeedSourceDomain }}
+ </a>
+
+ &middot; <a href="{{ .FeedLink }}">
+ <time
+ datetime="{{ .FeedDateTime }}"
+ title="{{ .FeedDateTime | time.Format "Monday, January 2 2006 at 15:04:05 MST" }}">
+ {{ .FeedDate }}
+ </time>
+ </a>
+
+ &middot; {{- partial "read-time.html" (dict "WordCount" .FeedWordCount) -}}
+
+ &middot; <word-limit>
+ <word-count title="{{ .FeedWordCount }} words">
+ {{ .FeedWordCount }} words
+ </word-count>
+ </word-limit>
+ </section>
+ </micro-metadata>
+ <p>{{ .FeedContent }}.</p>
+ </micro-content>
+ </micro-summary>
+</micro-card>