commit a582d4fa504124815d15faf4d41f8d4d68a2bdec
parent e52d392560f06b5bf550322f452574983a494e9c
Author: Nuno Sempere <nuno.semperelh@protonmail.com>
Date: Sun, 14 Aug 2022 22:59:47 +0000
feat: update rss so that pubdate roughly corresponds to post publishing date
Diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/apps/blagh/rss20.tpl b/apps/blagh/rss20.tpl
@@ -5,8 +5,11 @@ fn statpost {
f = $1
post_uri = `{echo $f | sed 's,^'$sitedir',,'}
title=`{read $f/index.md}
- post_uri=$base_url^`{cleanname `{echo $f | sed -e 's!^'$sitedir'!!'}}^'/'
+ relative_uri=`{cleanname `{echo $f | sed -e 's!^'$sitedir'!!'}}
+ post_uri=$base_url^$relative_uri^'/'
by=`{ls -m $f | sed 's/^\[//g; s/].*$//g' >[2]/dev/null}
+ extracted_on=`{echo $relative_uri | sed 's|/blog/||g' | head -c 10 }
+ published_on=`{ /bin/date -R -D '%Y/%m/%d' -d $extracted_on }
ifs=() {summary=`{ cat $f/index.md |strip_title_from_md_file | head -n 9 | ifs=$difs {$formatter | escape_html} }}
}
@@ -38,7 +41,7 @@ fn statpost {
%}
<link>%($post_uri%)</link>
<guid isPermaLink="true">%($post_uri%)</guid>
- <pubDate>%($pubdate%)</pubDate>
+ <pubDate>%( $published_on %)</pubDate>
<description> %($summary%) </description>
</item>
% }