Correct Jekyll feed parsing

jekyll is dumb.  there I said it.
This commit is contained in:
Case Duckworth 2022-08-08 22:32:39 -05:00
parent c68d139a47
commit 31b7529778
1 changed files with 9 additions and 9 deletions

View File

@ -93,22 +93,22 @@ orange_pecan_mousse() {
if [ -z "$is_rss" ]; then if [ -z "$is_rss" ]; then
# Select the first instance of the opening tag, mark the closing tag, # Select the first instance of the opening tag, mark the closing tag,
# trim off everything after and before the tags, clean inner html # trim off everything after and before the tags, clean inner html
sprinkle=$(echo -e "$germ" | grep -m 1 "<title" | sprinkle=$(echo -e "$germ" |
sed "0,/<title>/ s/<title>//" | awk '/<title/{title=1}
sed "0,/<title/ s/<title type=\"html\">//" | sed "s/<\/title>.*//" | title{sub(/.*<title[^>]*>/,"");
sed "s/.*<title>//" | sed "s/.*<title type=\"html\">//" | if(sub(/<\/title>.*/,"")) title=0;
sed "s/<!\[CDATA\[//" | sed "s/\]\]>//" | sed "s/ //") print;}
!title{exit}')
# RSS # RSS
else else
sprinkle=$(echo -e "$germ" | grep -m 1 "<title>" | sprinkle=$(echo -e "$germ" | grep -m 1 "<title>" |
sed "s/.*<title>//" | sed "s/<\/title>.*//" | sed "s/.*<title>//" | sed "s/<\/title>.*//" |
sed "s/<!\[CDATA\[//" | sed "s/\]\]>//" | sed "s/ //") sed "s/<!\[CDATA\[//" | sed "s/\]\]>//" | tr -d \\n)
pearl=$(echo -e "$germ" | grep -m 1 "<link>" | pearl=$(echo -e "$germ" | grep -m 1 "<link>" |
sed "s/.*<link>//" | sed "s/<\/link>.*//" | sed "s/ //") sed "s/.*<link>//" | sed "s/<\/link>.*//" | tr -d \\n)
luncheon=$(echo -e "$germ" | grep -m 1 "<description>" | luncheon=$(echo -e "$germ" | grep -m 1 "<description>" |
sed "s/.*<description>//" | sed "s/<\/description>.*//" | sed "s/.*<description>//" | sed "s/<\/description>.*//" |
sed "s/<!\[CDATA\[//" | sed "s/\]\]>//" | sed "s/ //") sed "s/<!\[CDATA\[//" | sed "s/\]\]>//" | tr -d \\n)
fi fi
# Guess the website URL from the feed URL to avoid parsing # Guess the website URL from the feed URL to avoid parsing
# strings with multiple link tags and no newline delimiters, # strings with multiple link tags and no newline delimiters,