Skip to content

Commit c6ef833

Browse files
committed
Add ga
1 parent 46cf21d commit c6ef833

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ exclude:
2121
- fabfile.py
2222

2323
disqus: eleme
24+
ga: "UA-2513347-13"
2425
nav:
2526
- title: 博客
2627
link: /blog/

_includes/ga.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{% if site.ga %}
2+
<script>
3+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
4+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
5+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
6+
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
7+
ga('create', '{{ site.ga }}', 'auto');
8+
ga('send', 'pageview');
9+
</script>
10+
{% endif %}

_layouts/default.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<link rel="alternate" type="application/atom+xml" title="Subscribe Feed" href="/feed.xml">
88
<link rel="stylesheet" href="/static/vendor.css">
99
<link rel="stylesheet" href="/static/site.css">
10+
{% include ga.html %}
1011
</head>
1112
<body>
1213
<header id="header">

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<title>{{ site.name }}</title>
1010
<link rel="stylesheet" href="/static/vendor.css">
1111
<link rel="stylesheet" href="/static/site.css">
12+
{% include ga.html %}
1213
</head>
1314
<body>
1415
<header id="header">

0 commit comments

Comments
 (0)