Skip to content

Commit

Permalink
add google analyics
Browse files Browse the repository at this point in the history
  • Loading branch information
nrlakin committed Mar 7, 2017
1 parent ca7a695 commit 82ffb96
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 21 deletions.
5 changes: 0 additions & 5 deletions home/frontend/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ def index():
return render_template('index.html',
title='Home')

@frontend.route('/about')
def about():
return render_template('about.html',
title='About This Page')

@frontend.route('/resume')
def get_resume():
return render_template('resume.html',
Expand Down
13 changes: 0 additions & 13 deletions home/templates/about.html

This file was deleted.

4 changes: 3 additions & 1 deletion home/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
<script src="/static/js/bootstrap.min.js"></script>
<script src="/static/js/moment.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">

{% include "google_analytics.html" %}

</head>
<body>
<div class="container">
Expand All @@ -32,7 +35,6 @@
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="{{ url_for('frontend.index') }}">Home<span class="sr-only">(current)</span></a></li>
<li><a href="{{ url_for('frontend.about') }}">About<span class="sr-only">(current)</span></a></li>
</ul>
</div>
</div>
Expand Down
10 changes: 10 additions & 0 deletions home/templates/google_analytics.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-93168915-1', 'auto');
ga('send', 'pageview');

</script>
4 changes: 2 additions & 2 deletions home/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
{% include "flash.html" %}
<div class="container">
<h1>Welcome to Neil's homepage.</h1>
<p>Sometimes this is a blog. Sometimes it's a project. Right now it's a placeholder.</p>
<p>Go check out my latest projects:</p>
<p>Sometimes it's an API server for hardware. Sometimes it's a project. Right now it's a placeholder.</p>
<p>Go check out some projects:</p>
<ul>
<li><a href="http://somerandom.herokuapp.com">Some Random On Twitter</a>.
<a href="https://github.com/nrlakin/somerandom">[github]</a>
Expand Down

0 comments on commit 82ffb96

Please sign in to comment.