Remove bad css from non-mesh pelican installs

This commit is contained in:
Bob Mottram 2017-12-09 14:40:18 +00:00
parent d61d410746
commit 85126cec66
1 changed files with 8 additions and 0 deletions

View File

@ -275,6 +275,13 @@ function pelican_delete_blog {
esac
}
function pelican_remove_bad_blog_links {
current_theme=$1
if [ -f $PELICAN_BLOG_INSTALL_DIR/themes/$current_theme/static/css/style.css ]; then
sed -i '/googleapi/d' $PELICAN_BLOG_INSTALL_DIR/themes/$current_theme/static/css/style.css
fi
}
function pelican_change_theme {
THEMES=()
for d in $PELICAN_BLOG_INSTALL_DIR/themes/*/ ; do
@ -323,6 +330,7 @@ function pelican_change_theme {
CHOSEN_THEME_INDEX=$((CHOSEN_THEME_INDEX - 1))
CHOSEN_THEME=${THEMES[$CHOSEN_THEME_INDEX]}
pelican_remove_bad_blog_links $CHOSEN_THEME
if grep -q "THEME=" $PELICAN_BLOG_INSTALL_DIR/pelicanconf.py; then
sed -i "s|THEME=.*|THEME='themes/${CHOSEN_THEME}'|g" $PELICAN_BLOG_INSTALL_DIR/pelicanconf.py
else