Permalink
Browse files

Adds ga code from ignored template.

  • Loading branch information...
1 parent a182b32 commit 081719affddb92de67aed0eb61871a5c5e9bc0d3 @ehmatthes committed Apr 14, 2015
View
@@ -1,8 +1,7 @@
notes/*
*~
-ignored_resources/*
*.ipynb_checkpoints
*#
notebooks/*.html*
notebooks/__pycache__
-
+notebooks/my_templates/ignored_templates
@@ -27,6 +27,7 @@
<script type='text/javascript' src='js/nbconvert_js.js'></script>
<script type='text/javascript' src='js/show_hide_output.js'></script>
+ {% include "my_templates/ignored_templates/ga.tpl" ignore missing %}
</head>
{%- endblock header -%}
@@ -1,19 +0,0 @@
-# To insert Google Analytics code,
-# store it as "intro_programming/ignored_resources/ga_code.txt".
-# Newlines in GA code may throw errors; download or make a one-line version
-# of your GA code.
-#
-# Insert Google Analytics code just before </head>, if analytics code exists
-printf "\nInserting Google Analytics code..."
-
-if [ -e "../ignored_resources/ga_code.txt" ] ; then
- ga_code=$(<../ignored_resources/ga_code.txt)
- find ../notebooks -iname '*.html' | xargs sed -i "s#<\/head>#$ga_code\n<\/head>\n#g"
- printf "\nInserted analytics code.\n"
-
-else
- ga_code=$(<ignored_resources/ga_code.txt)
- find notebooks -iname '*.html' | xargs sed -i "s#<\/head>#$ga_code\n<\/head>\n#g"
- printf "\nInserted analytics code.\n"
-
-fi

0 comments on commit 081719a

Please sign in to comment.