소스 검색

Improve removal of bad links

Bob Mottram 7 년 전
부모
커밋
d32c6d9499
1개의 변경된 파일12개의 추가작업 그리고 6개의 파일을 삭제
  1. 12
    6
      src/freedombone-mesh-blog

+ 12
- 6
src/freedombone-mesh-blog 파일 보기

42
 DEFAULT_BLOG_TITLE=$"Freedombone Blog"
42
 DEFAULT_BLOG_TITLE=$"Freedombone Blog"
43
 
43
 
44
 function remove_bad_blog_links {
44
 function remove_bad_blog_links {
45
+    find ./ -type f -name *.css -exec sed -i -e '/googleapi/d' {} \;
46
+    find ./ -type f -name *.scss -exec sed -i -e '/googleapi/d' {} \;
47
+    find ./ -type f -name *.html -exec sed -i -e '/googleapi/d' {} \;
48
+    find ./ -type f -name *.css -exec sed -i -e '/bootstrapcdn/d' {} \;
49
+    find ./ -type f -name *.scss -exec sed -i -e '/bootstrapcdn/d' {} \;
50
+    find ./ -type f -name *.html -exec sed -i -e '/bootstrapcdn/d' {} \;
51
+}
52
+
53
+function remove_bad_blog_links_from_theme {
45
     current_theme=$1
54
     current_theme=$1
46
 
55
 
47
     cd $BLOG_PATH/themes/$current_theme
56
     cd $BLOG_PATH/themes/$current_theme
48
-    find ./ -type f -name *.css -exec sed -i -e '/fonts.googleapis.com/d' {} \;
49
-    find ./ -type f -name *.html -exec sed -i -e '/fonts.googleapis.com/d' {} \;
57
+    remove_bad_blog_links
50
 }
58
 }
51
 
59
 
52
 function ipfs_publish {
60
 function ipfs_publish {
82
     fi
90
     fi
83
     make html
91
     make html
84
 
92
 
85
-    # remove any google fonts
86
     cd $BLOG_PATH
93
     cd $BLOG_PATH
87
-    find ./ -type f -name *.css -exec sed -i -e '/fonts.googleapis.com/d' {} \;
88
-    find ./ -type f -name *.html -exec sed -i -e '/fonts.googleapis.com/d' {} \;
94
+    remove_bad_blog_links
89
 
95
 
90
     ipfs_publish
96
     ipfs_publish
91
 }
97
 }
213
     CHOSEN_THEME_INDEX=$((CHOSEN_THEME_INDEX - 1))
219
     CHOSEN_THEME_INDEX=$((CHOSEN_THEME_INDEX - 1))
214
 
220
 
215
     CHOSEN_THEME=${THEMES[$CHOSEN_THEME_INDEX]}
221
     CHOSEN_THEME=${THEMES[$CHOSEN_THEME_INDEX]}
216
-    remove_bad_blog_links $CHOSEN_THEME
222
+    remove_bad_blog_links_from_theme $CHOSEN_THEME
217
     if grep -q "THEME=" $BLOG_PATH/pelicanconf.py; then
223
     if grep -q "THEME=" $BLOG_PATH/pelicanconf.py; then
218
         sed -i "s|THEME=.*|THEME='themes/${CHOSEN_THEME}'|g" $BLOG_PATH/pelicanconf.py
224
         sed -i "s|THEME=.*|THEME='themes/${CHOSEN_THEME}'|g" $BLOG_PATH/pelicanconf.py
219
     else
225
     else