浏览代码

Remove bad css from non-mesh pelican installs

Bob Mottram 7 年前
父节点
当前提交
85126cec66
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8
    0
      src/freedombone-app-pelican

+ 8
- 0
src/freedombone-app-pelican 查看文件

@@ -275,6 +275,13 @@ function pelican_delete_blog {
275 275
     esac
276 276
 }
277 277
 
278
+function pelican_remove_bad_blog_links {
279
+    current_theme=$1
280
+    if [ -f $PELICAN_BLOG_INSTALL_DIR/themes/$current_theme/static/css/style.css ]; then
281
+        sed -i '/googleapi/d' $PELICAN_BLOG_INSTALL_DIR/themes/$current_theme/static/css/style.css
282
+    fi
283
+}
284
+
278 285
 function pelican_change_theme {
279 286
     THEMES=()
280 287
     for d in $PELICAN_BLOG_INSTALL_DIR/themes/*/ ; do
@@ -323,6 +330,7 @@ function pelican_change_theme {
323 330
     CHOSEN_THEME_INDEX=$((CHOSEN_THEME_INDEX - 1))
324 331
 
325 332
     CHOSEN_THEME=${THEMES[$CHOSEN_THEME_INDEX]}
333
+    pelican_remove_bad_blog_links $CHOSEN_THEME
326 334
     if grep -q "THEME=" $PELICAN_BLOG_INSTALL_DIR/pelicanconf.py; then
327 335
         sed -i "s|THEME=.*|THEME='themes/${CHOSEN_THEME}'|g" $PELICAN_BLOG_INSTALL_DIR/pelicanconf.py
328 336
     else