aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/function-generate-feeds.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/default/layouts/partials/function-generate-feeds.html')
-rw-r--r--themes/default/layouts/partials/function-generate-feeds.html42
1 files changed, 21 insertions, 21 deletions
diff --git a/themes/default/layouts/partials/function-generate-feeds.html b/themes/default/layouts/partials/function-generate-feeds.html
index 42ffd8b..57789b5 100644
--- a/themes/default/layouts/partials/function-generate-feeds.html
+++ b/themes/default/layouts/partials/function-generate-feeds.html
@@ -19,7 +19,7 @@
{{- with $fetch | transform.Unmarshal -}}
{{- $content := "" -}}
- {{- $date := now.Format "2006-01-02T15:04:05Z" -}}
+ {{- $date := now | time.Format "2006-01-02T15:04:05Z" -}}
{{- $description := "" -}}
{{- $enclosure := "" -}}
{{- $imageLink := "" -}}
@@ -136,7 +136,7 @@
{{- end -}}
- {{- $sourceDomain := ($sourceLink | plainify | html | htmlUnescape | urls.Parse).Host -}}
+ {{- $sourceDomain := ($sourceLink | plainify | htmlUnescape | urls.Parse).Host -}}
{{- /* Replace invalid time zones. */ -}}
{{- $date = replaceRE "G[0-9]+T" "UTC" $date -}}
@@ -158,23 +158,23 @@
{{-
$feeds = $feeds | append (dict
- "FeedContent" ($content | plainify | html | htmlUnescape)
- "FeedContentShort" (delimit (first 2 (split ($content | plainify | html | htmlUnescape) "\n")) " " | truncate 250)
- "FeedDate" ($date | plainify | html | htmlUnescape | time.Format "January 2, 2006")
- "FeedDateTime" ($date | plainify | html | htmlUnescape | time.Format "2006-01-02T15:04:05Z")
- "FeedDateTitle" ($date | plainify | html | htmlUnescape | time.Format "Monday, January 2 2006 at 15:04:05 MST")
- "FeedDescription" ($description | plainify | html | htmlUnescape)
- "FeedDescriptionShort" (delimit (first 2 (split ($description | plainify | html | htmlUnescape) "\n")) " " | truncate 250)
- "FeedEnclosure" ($enclosure | plainify | html | htmlUnescape)
- "FeedImageLink" ($imageLink | plainify | html | htmlUnescape)
- "FeedLink" ($link | plainify | html | htmlUnescape)
- "FeedName" (or $retitle (delimit (first 2 (split ($sourceTitle | plainify | html | htmlUnescape) " ")) " "))
- "FeedSourceDescription" ($sourceDescription | plainify | html | htmlUnescape)
- "FeedSourceDomain" ($sourceDomain | plainify | html | htmlUnescape)
- "FeedSourceLink" ($sourceLink | plainify | html | htmlUnescape)
- "FeedSourceHome" ($sourceHome | plainify | html | htmlUnescape)
- "FeedSourceTitle" ($sourceTitle | plainify | html | htmlUnescape)
- "FeedTitle" ($title | plainify | html | htmlUnescape)
+ "FeedContent" ($content | plainify | htmlUnescape)
+ "FeedContentShort" (delimit (first 2 (split ($content | plainify | htmlUnescape) "\n")) " " | truncate 250 "...")
+ "FeedDate" ($date | plainify | htmlUnescape | time.Format "Mon Jan 2 2006")
+ "FeedDateTime" ($date | plainify | htmlUnescape | time.Format "2006-01-02T15:04:05Z")
+ "FeedDateTitle" ($date | plainify | htmlUnescape | time.Format "Monday January 2 2006 at 15:04:05 MST")
+ "FeedDescription" ($description | plainify | htmlUnescape)
+ "FeedDescriptionShort" (delimit (first 2 (split ($description | plainify | htmlUnescape) "\n")) " " | truncate 250 "...")
+ "FeedEnclosure" ($enclosure | plainify | htmlUnescape)
+ "FeedImageLink" ($imageLink | plainify | htmlUnescape)
+ "FeedLink" ($link | plainify | htmlUnescape)
+ "FeedName" (or $retitle (delimit (first 2 (split ($sourceTitle | plainify | htmlUnescape) " ")) " "))
+ "FeedSourceDescription" ($sourceDescription | plainify | htmlUnescape)
+ "FeedSourceDomain" ($sourceDomain | plainify | htmlUnescape)
+ "FeedSourceLink" ($sourceLink | plainify | htmlUnescape)
+ "FeedSourceHome" ($sourceHome | plainify | htmlUnescape)
+ "FeedSourceTitle" ($sourceTitle | plainify | htmlUnescape)
+ "FeedTitle" ($title | plainify | htmlUnescape)
)
-}}
@@ -229,12 +229,12 @@
"description" (or .FeedSourceDescription .FeedSourceTitle "No source description found.")
"domain" .FeedSourceDomain
"enclosure" .FeedEnclosure
- "favicon" $imageSource.RelPermalink
+ "favicon" (strings.TrimPrefix ("" | absURL) $imageSource.Permalink)
"home" .FeedSourceHome
"link" .FeedLink
"name" .FeedName
"source" .FeedSourceLink
- "tags" "[rss]"
+ "tags" "[feeds]"
)
$template
-}}