aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-11-28 16:34:49 -0500
committertdro <tdro@noreply.example.com>2022-11-28 16:37:10 -0500
commit9ab68cefd02b8340994880b7158789a125069174 (patch)
tree7c1520d3ae7fdcb07d9edbafcf9e4249704cfdfb
parent346ac9b3efe228f18fb40aac20d7f6d84292973f (diff)
downloadcanory-9ab68cefd02b8340994880b7158789a125069174.tar.gz
canory-9ab68cefd02b8340994880b7158789a125069174.tar.bz2
canory-9ab68cefd02b8340994880b7158789a125069174.zip
themes/default/layouts/partials/function-generate-feeds: Allow retitling feeds
By appending to data sequence: feeds: rss: - https://codeberg.org/tdro/canory.rss Canory
-rw-r--r--themes/default/layouts/partials/function-generate-feeds.html10
1 files changed, 7 insertions, 3 deletions
diff --git a/themes/default/layouts/partials/function-generate-feeds.html b/themes/default/layouts/partials/function-generate-feeds.html
index 547a7e3..545e1b8 100644
--- a/themes/default/layouts/partials/function-generate-feeds.html
+++ b/themes/default/layouts/partials/function-generate-feeds.html
@@ -6,13 +6,17 @@
{{- range $key, $value := (seq 3) -}}
{{- range $author.feeds.rss -}}
- {{- with resources.GetRemote . -}}
+ {{- $data := split . " " -}}
+ {{- $url := delimit (first 1 $data) "" -}}
+ {{- $retitle := delimit (after 1 $data) " " -}}
+
+ {{- with resources.GetRemote $url -}}
{{- with .Err -}}
{{- warnf "Feed fetch %s" . -}}
{{- end -}}
{{- end -}}
- {{- with resources.GetRemote . | transform.Unmarshal -}}
+ {{- with resources.GetRemote $url | transform.Unmarshal -}}
{{- $content := "" -}}
{{- $date := now.Format "2006-01-02T15:04:05Z" -}}
@@ -172,7 +176,7 @@
"FeedEnclosure" ($enclosure | plainify | html | htmlUnescape)
"FeedImageLink" ($imageLink | plainify | html | htmlUnescape)
"FeedLink" ($link | plainify | html | htmlUnescape)
- "FeedName" (delimit ((delimit (first 2 (split ($sourceTitle | plainify | html | htmlUnescape) " ")) " ") | findRE "^([^.|?|!|\n|\"|]+)") " " | replaceRE "[^a-zA-Z ]" "")
+ "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)