diff options
| author | tdro <tdro@noreply.example.com> | 2022-06-05 00:58:11 -0400 |
|---|---|---|
| committer | tdro <tdro@noreply.example.com> | 2022-06-05 00:58:11 -0400 |
| commit | cd68dc36d2047eae228c98448798f092ec5119bc (patch) | |
| tree | 7585bacd69e415f9d907d1989bf9251d471fd1f5 | |
| parent | 4c559daf909f025c5e8761e27be6a02fb5f2608f (diff) | |
| download | canory-cd68dc36d2047eae228c98448798f092ec5119bc.tar.gz canory-cd68dc36d2047eae228c98448798f092ec5119bc.tar.bz2 canory-cd68dc36d2047eae228c98448798f092ec5119bc.zip | |
themes/default/layouts/partials/feeds-generate: Handle common failures
Handle common time zone typos and reduce date string size on parse failure and
re-parse.
| -rw-r--r-- | themes/default/layouts/partials/feeds-generate.html | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/themes/default/layouts/partials/feeds-generate.html b/themes/default/layouts/partials/feeds-generate.html index 068ad40..a9fb392 100644 --- a/themes/default/layouts/partials/feeds-generate.html +++ b/themes/default/layouts/partials/feeds-generate.html @@ -87,6 +87,14 @@ {{ end -}} + {{- /* Common time zone typos */ -}} + {{ $date = strings.Replace $date "G6T" "GST" }} + + {{- /* If missing seconds split and try again. */ -}} + {{ if lt (len (split $date ":")) 3 }} + {{ $date = delimit (first 3 (after 1 (split $date " "))) " " }} + {{ end }} + {{ $feeds = $feeds | append (dict "FeedContent" ($content | plainify | htmlUnescape) |
