Skip to content

Commit 049512c

Browse files
committed
add _remove_google_analytics function
1 parent d9144f6 commit 049512c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

migration/cleanup_html.sh

+15
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,20 @@ function _remove_deprecated_links_meta_from_html_files {
4242
}
4343

4444

45+
function _remove_google_analytics {
46+
printf "\e[1m\e[7m %-80s\e[0m\n" \
47+
'Remove Google Analytics'
48+
for _file in $(find docs -type f -name '*.html')
49+
do
50+
${SED} \
51+
--null-data \
52+
-e's#<!-- Begin Google.*<!-- End Google Analytics -->##' \
53+
--in-place "${_file}"
54+
done
55+
echo
56+
}
57+
58+
4559
function _cleanup_plaintext_whitespace {
4660
printf "\e[1m\e[7m %-80s\e[0m\n" 'Clean-up whitespace in plaintext files'
4761
# plaintext files with trailing whitespace
@@ -58,4 +72,5 @@ function _cleanup_plaintext_whitespace {
5872
cd "${0%/*}/.." >/dev/null
5973
# Run clean-up functions
6074
_remove_deprecated_links_meta_from_html_files
75+
_remove_google_analytics
6176
_cleanup_plaintext_whitespace

0 commit comments

Comments
 (0)