run.sh (634B)
1 #!/usr/bin/env sh
2
3 # Generate site
4 printf "Fetching feeds and generating html...\n"
5 perlanet config.yaml
6
7 # Insert Update time
8 printf "Inserting update time...\n"
9 DATE=`date +%c`
10 sed -E -e "s/<!--UPDATED-->/$DATE/" -i index.html
11
12 # Insert feeds list
13 printf "Inserting feeds list...\n"
14 FEEDS=`
15 grep -E '^\s*web:' config.yaml | \
16 awk '{ print "<a href=\""$NF"\">"$NF"</a><br>" }' | \
17 sed -e 's/\//\\\\\//g' -ze's/\n//g'
18 `
19 sed -E -e "s/<!--FEEDS-->/$FEEDS/" -i index.html
20
21 # remove images and iframes from article previews
22 printf "Removing images and iframes...\n"
23 sed -E -e 's/<img[^>]*>//g' -e 's/<iframe[^>]*>//g' -i index.html