sbrs

Simple blog and RSS system
git clone git://git.christosmarg.xyz/sbrs.git
Log | Files | Refs | README | LICENSE

commit 19ad369ce472a007983cf990fc6de273044a1aa5
parent 97df897c9454f33944c57be175500036da17d3c8
Author: Christos Margiolis <christos@margiolis.net>
Date:   Sat, 22 Aug 2020 15:53:42 +0300

added rss removal

Diffstat:
Mautoblog | 7++++---
Mrss.xml | 1-
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/autoblog b/autoblog @@ -51,9 +51,10 @@ publish() delete() { [ $(echo "$blogpost" | wc -l) -gt 1 ] && echo "Invalid choice" && exit - [ "$1" = "$blogdir" ] && sed -i "/$blogpost/d" $index $blogindex - # TODO add RSS removal - rm $1/$blogpost.html && echo "Removed $blogdir." + [ "$1" = "$blogdir" ] && + sed -i "/$blogpost/d" $index $blogindex && + sed -ni "/<item>/{ :loop; N; s/<\\/item>/&/; T loop; s/$blogpost/&/; T keep; d }; :keep; p" $rssfile + rm $1/$blogpost.html && echo "Removed $blogpost." } case $1 in diff --git a/rss.xml b/rss.xml @@ -7,7 +7,6 @@ <link>https://yourwebsite.com/rss.xml</link> <!--BLOG--> - <item> <title>Sample post</title> <guid>https://yourwebsite.com/sample-post.html</guid>