diff options
author | Tyler Davis <tyler@gluecode.net> | 2025-02-20 22:51:23 +0000 |
---|---|---|
committer | Tyler Davis <tyler@gluecode.net> | 2025-02-20 22:51:23 +0000 |
commit | b566bf5c835e04e745dabb6bd1232ac8a09873ef (patch) | |
tree | ea806db591bbe03897a1de6b4c6701d9b13b4c92 /rss.sh | |
parent | 2f182b05325c159e618ad1675c007566e9d1694e (diff) | |
download | journal-b566bf5c835e04e745dabb6bd1232ac8a09873ef.tar.gz journal-b566bf5c835e04e745dabb6bd1232ac8a09873ef.zip |
Switch to lowdown for html generation
Diffstat (limited to 'rss.sh')
-rwxr-xr-x | rss.sh | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -20,8 +20,8 @@ postDir="/var/www/blog/posts" ### header=""" -<?xml version='1.0' encoding='UTF-8' ?> -<rss version='2.0' xmlns:atom='http://www.w3.org/2005/Atom'> +<?xml version="1.0" encoding="UTF-8" ?> +<rss version="2.0"> <channel> <title>${title}</title> <link>${link}</link> @@ -29,28 +29,29 @@ header=""" <atom:link href='${rsslink}' rel='self' type='application/rss+xml' /> """ -footer="</channel> </rss>" +footer="</channel></rss>" echo $header >> $TEMPFILE postArray=( $(ls -r "$postDir"/*/*.html) ) numPosts=$(ls "$postDir"/*/*.html | wc -l) echo "numposts is $numPosts" -postNum=0 for posts in "${postArray[@]}"; do - let postNum+=1 post=$posts fullTitle=$(grep -o '>.*</h1>' $post | sed -e 's,>,,g' -e 's,</h1,,g') postname=${post##*/} linkadd="$link"/"$postname" guidadd=$linkadd + LEN=$(wc -l ${post}|awk '{print $1}') extract=$(cat $post | head -n $((${LEN}-1)) | tail -n $((${LEN}-3)) ) + echo """<item> <title>$fullTitle</title> <link>$linkadd</link> <guid>$linkadd</guid> - <description>$extract</description> + <description>$fulltitle</description> + <content type="text/html" mode="escaped">$extract</content> </item> """ >> $TEMPFILE done |