From 5e711b5f6bb68cdbc72c974e337a68e6f1b855eb Mon Sep 17 00:00:00 2001 From: Lux49 Date: Fri, 17 Jul 2020 14:29:37 +0200 Subject: [PATCH] customize rss feed --- blog-refresh.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/blog-refresh.sh b/blog-refresh.sh index 1d77828..658c483 100755 --- a/blog-refresh.sh +++ b/blog-refresh.sh @@ -22,7 +22,7 @@ add_header() { Lucy Lucys blog' - output_rss " + output_rss " Lucys blog" } @@ -34,12 +34,12 @@ add_footer() { html_entry() { output '' - path="$1" + webpath="$1" time="$2" title="$3" output "$title" output "$time" - output_entrylist "[$title]($path)|$time" + output_entrylist "[$title]($webpath)|$time" } rss_entry() { @@ -48,13 +48,18 @@ rss_entry() { # and with escaped html. # The sed expression is stolen from https://stackoverflow.com/questions/12873682/12873723#12873723 output_rss " - $1 - $blog_domain$2 + $1 + $(date --rfc-3339=seconds -d $4 | sed 's/ /T/') + $blog_domain$2 + +$(grep -h '^

' "dist/$2" | head -n 1 | sed 's/^/ /') +

- $(tail -n+2 "$2" | sed 's/&/\&/g; s//\>/g; s/"/\"/g; s/'"'"'/\'/g') +$(pandoc $3 | sed 's/^/ /')
" + # $(tail -n+2 "$2" | sed 's/&/\&/g; s//\>/g; s/"/\"/g; s/'"'"'/\'/g') } create_entry() { @@ -66,7 +71,7 @@ create_entry() { title=$(grep -h '' "dist/$outpath" | sed 's/<title>//g;s/<\/title>//g') created=$(grep -h '^date: ' "$path" | sed 's/date: //g') html_entry "$outpath" "$created" "$title" - rss_entry "$title" "dist/$outpath" + rss_entry "$title" "$outpath" $path $created } convert_static() { @@ -85,7 +90,7 @@ has_updates() { fi } -cd /home/lucy/blog-content/ +#cd /home/lucy/blog-content/ rm -R dist/* rsync --delete -avxt static/ dist/ add_header