diff --git a/blog-refresh.sh b/blog-refresh.sh index 937818e..1f957a0 100755 --- a/blog-refresh.sh +++ b/blog-refresh.sh @@ -22,13 +22,13 @@ add_header() { Lucy Lucys blog' - output_rss " $(date --rfc-3339=seconds | sed 's/ /T/') + output_rss " $(date --iso-8601=seconds) https://lucy.moe/rss.xml " } add_footer() { - html_entry "https://asagi.moe" "before July 2020" "Old site" "de/en" + html_entry "https://asagi.moe" "before July 2020" "Old site" output '' output_rss '' } @@ -50,8 +50,8 @@ rss_entry() { # The sed expression is stolen from https://stackoverflow.com/questions/12873682/12873723#12873723 output_rss " $1 - $(date --rfc-3339=seconds -d $4 | sed 's/ /T/') - $(date --rfc-3339=seconds -r $3 | sed 's/ /T/') + $(date --iso-8601=seconds -d $4) + $(date --iso-8601=seconds -r $3) $blog_domain$2 @@ -72,7 +72,8 @@ create_entry() { # then add it to the index 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" + created_date=$(date +%x --date="$created") + html_entry "$outpath" "$created_date" "$title" rss_entry "$title" "$outpath" $path $created }