aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-06-04 02:01:29 -0400
committertdro <tdro@noreply.example.com>2022-06-04 02:01:29 -0400
commit9a023e75ac3eadcab97222903f9b84dee0fd1f7e (patch)
treece555c2e5c7169bc452ddc7bfe027e7edb378e75
parent99cfb5d9e23bae21bc3b40a77cac1b63767af6e4 (diff)
downloadcanory-9a023e75ac3eadcab97222903f9b84dee0fd1f7e.tar.gz
canory-9a023e75ac3eadcab97222903f9b84dee0fd1f7e.tar.bz2
canory-9a023e75ac3eadcab97222903f9b84dee0fd1f7e.zip
themes/default/layouts/partials/feeds-generate: Truncate short content/description
Truncate if newline delimit exceeds truncation length.
-rw-r--r--themes/default/layouts/partials/feeds-generate.html4
1 files changed, 2 insertions, 2 deletions
diff --git a/themes/default/layouts/partials/feeds-generate.html b/themes/default/layouts/partials/feeds-generate.html
index 6dd94d7..ab60435 100644
--- a/themes/default/layouts/partials/feeds-generate.html
+++ b/themes/default/layouts/partials/feeds-generate.html
@@ -83,12 +83,12 @@
{{
$feeds = $feeds | append (dict
"FeedContent" ($content | plainify | htmlUnescape)
- "FeedContentShort" (delimit (first 1 (split ($content | plainify | htmlUnescape) "\n")) " ")
+ "FeedContentShort" (delimit (first 1 (split ($content | plainify | htmlUnescape) "\n")) " " | truncate 250)
"FeedDate" ($date | plainify | htmlUnescape | time.Format "January 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 1 (split ($description | plainify | htmlUnescape) "\n")) " ")
+ "FeedDescriptionShort" (delimit (first 1 (split ($description | plainify | htmlUnescape) "\n")) " " | truncate 250)
"FeedLink" ($link | plainify | htmlUnescape)
"FeedName" (delimit ((delimit (first 3 (split ($sourceTitle | plainify | htmlUnescape) " ")) " ") | findRE "^([^.|:|?|!]+)") " " | replaceRE "[^a-zA-Z ]" "")
"FeedSourceDescription" ($sourceDescription | plainify | htmlUnescape)