Skip to content
Snippets Groups Projects
Commit d32c6d94 authored by Bob Mottram's avatar Bob Mottram
Browse files

Improve removal of bad links

parent 2cbdc9ed
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment