Skip to content

Commit

Permalink
Fix RSS guids
Browse files Browse the repository at this point in the history
  • Loading branch information
whiteinge committed Jun 19, 2020
1 parent 7fda5d5 commit 52dea51
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ _metadata_cache: $(MTA)

$(IDX): _metadata_cache

rss.xml: _metadata_cache
rss.xml: _metadata_cache _make_rss.sh
./_make_rss.sh | m4 -P _macros.m4 - > $@

# resume.html: resume.rst resume.css
Expand Down
7 changes: 4 additions & 3 deletions _make_rss.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@ printf '<?xml version="1.0" encoding="UTF-8"?>

< _metadata_cache sort -r -k2 | grep -v xDATE | head -10 \
| while IFS="$tab" read -r pfile pdate ptitle pcategories; do
fname=$(printf "%s\n" "$pfile" | sed -e 's/\.md$/.mdhtml/')
fname=$(printf "%s\n" "$pfile" | sed -e 's/\.md$/.html/')
iname=$(printf "%s\n" "$pfile" | sed -e 's/\.md$/.mdhtml/')
fpath=$(dirname "$pfile")
printf '<item>\n'
printf '<title>%s</title>\n' "$ptitle"
printf '<link>xROOT/%s</link>\n' "$pfile"
printf '<description><![CDATA[\n'
cat "$fname" \
cat "$iname" \
| sed -e 's/src="\.\//src="xROOT\/'"$fpath"'\//g'
printf ']]></description>\n'
printf '<pubDate>%s</pubDate>\n' "$(date -d"$pdate" -R)"
printf '<guid>xROOT/%s</guid>\n' "$pfile"
printf '<guid>xROOT/%s</guid>\n' "$fname"
printf '</item>\n'
done

Expand Down

0 comments on commit 52dea51

Please sign in to comment.