From d32c6d9499900d222aed657bdf7c616570f758cb Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 30 Dec 2017 23:33:13 +0000 Subject: [PATCH] Improve removal of bad links --- src/freedombone-mesh-blog | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/freedombone-mesh-blog b/src/freedombone-mesh-blog index 366b87c4..28daa923 100755 --- a/src/freedombone-mesh-blog +++ b/src/freedombone-mesh-blog @@ -42,11 +42,19 @@ BLOG_EDITOR='pluma' DEFAULT_BLOG_TITLE=$"Freedombone Blog" function remove_bad_blog_links { + find ./ -type f -name *.css -exec sed -i -e '/googleapi/d' {} \; + find ./ -type f -name *.scss -exec sed -i -e '/googleapi/d' {} \; + find ./ -type f -name *.html -exec sed -i -e '/googleapi/d' {} \; + find ./ -type f -name *.css -exec sed -i -e '/bootstrapcdn/d' {} \; + find ./ -type f -name *.scss -exec sed -i -e '/bootstrapcdn/d' {} \; + find ./ -type f -name *.html -exec sed -i -e '/bootstrapcdn/d' {} \; +} + +function remove_bad_blog_links_from_theme { current_theme=$1 cd $BLOG_PATH/themes/$current_theme - find ./ -type f -name *.css -exec sed -i -e '/fonts.googleapis.com/d' {} \; - find ./ -type f -name *.html -exec sed -i -e '/fonts.googleapis.com/d' {} \; + remove_bad_blog_links } function ipfs_publish { @@ -82,10 +90,8 @@ function regenerate_blog { fi make html - # remove any google fonts cd $BLOG_PATH - find ./ -type f -name *.css -exec sed -i -e '/fonts.googleapis.com/d' {} \; - find ./ -type f -name *.html -exec sed -i -e '/fonts.googleapis.com/d' {} \; + remove_bad_blog_links ipfs_publish } @@ -213,7 +219,7 @@ function change_theme { CHOSEN_THEME_INDEX=$((CHOSEN_THEME_INDEX - 1)) CHOSEN_THEME=${THEMES[$CHOSEN_THEME_INDEX]} - remove_bad_blog_links $CHOSEN_THEME + remove_bad_blog_links_from_theme $CHOSEN_THEME if grep -q "THEME=" $BLOG_PATH/pelicanconf.py; then sed -i "s|THEME=.*|THEME='themes/${CHOSEN_THEME}'|g" $BLOG_PATH/pelicanconf.py else