aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/generate-feeds.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/default/layouts/partials/generate-feeds.html')
-rw-r--r--themes/default/layouts/partials/generate-feeds.html28
1 files changed, 14 insertions, 14 deletions
diff --git a/themes/default/layouts/partials/generate-feeds.html b/themes/default/layouts/partials/generate-feeds.html
index f502543..ec550d3 100644
--- a/themes/default/layouts/partials/generate-feeds.html
+++ b/themes/default/layouts/partials/generate-feeds.html
@@ -14,7 +14,7 @@
{{- with resources.GetRemote . | transform.Unmarshal -}}
- {{- $content := "No content found." -}}
+ {{- $content := "" -}}
{{- $date := now.Format "2006-01-02T15:04:05Z" -}}
{{- $description := "No description found." -}}
{{- $enclosure := "" -}}
@@ -200,10 +200,10 @@
{{- $imageSource := partial "function-caches-images.html"
(dict
- "Source" $faviconDomain
- "Fit" "160x160"
- "Target" (print (partial "function-paths.html" "media") "/")
- "Copy" (print (partial "function-paths.html" "media") "/favicon." $domain ".png")
+ "Source" $faviconDomain
+ "Fit" "160x160"
+ "Target" (print (partial "function-paths.html" "media") "/")
+ "Copy" (print (partial "function-paths.html" "media") "/favicon." $domain ".png")
)
-}}
@@ -212,21 +212,21 @@
{{- $file = partial "function-strip-urlchars.html" $file -}}
{{- $path := print "/data/generates/content/" $author.user "/feeds/" $file ".md" -}}
- {{- $description := .FeedDescriptionShort -}}
- {{- if gt (len .FeedTitle) (len .FeedDescriptionShort) -}}
- {{- $description = .FeedTitle -}}
- {{- end -}}
-
{{- $content := .FeedContentShort -}}
- {{- if or (eq $content "No content found.") (gt (len .FeedTitle) (len $content)) -}}
+
+ {{- if (gt (len .FeedTitle) (len $content)) -}}
{{- $content = .FeedTitle -}}
{{- end -}}
+ {{- if (gt (len .FeedDescriptionShort) (len .FeedTitle)) -}}
+ {{- $content = .FeedDescriptionShort -}}
+ {{- end -}}
+
{{- $markdown := resources.ExecuteAsTemplate
$path
(dict
"author" $author.user
- "content" $content
+ "content" (or $content "No content found.")
"date" .FeedDateTime
"description" (or .FeedSourceDescription .FeedSourceTitle "No source description found.")
"domain" .FeedSourceDomain
@@ -264,9 +264,9 @@
{{ .FeedDate }}
</time>
{{ if gt (len .FeedDescriptionShort) (len .FeedContentShort) -}}
- {{ "--" | markdownify }} {{ .FeedDescriptionShort }}
+ {{ "--" | markdownify }} {{ or .FeedDescriptionShort .FeedTitle }}
{{- else -}}
- {{ "--" | markdownify }} {{ .FeedContentShort }}
+ {{ "--" | markdownify }} {{ or .FeedContentShort .FeedTitle }}
{{- end }}
</p>