Browse Source

Add Google Analytics support

Closes #44
digitalcraftsman 7 years ago
parent
commit
7cf2943ef4
2 changed files with 19 additions and 1 deletions
  1. 17
    1
      README.md
  2. 2
    0
      layouts/_default/baseof.html

+ 17
- 1
README.md View File

15
   - [Themes](#themes)
15
   - [Themes](#themes)
16
   - [Reverse layout](#reverse-layout)
16
   - [Reverse layout](#reverse-layout)
17
   - [Disqus](#disqus)
17
   - [Disqus](#disqus)
18
+  - [Google Analytics](#google-analytics)
18
 - [Author](#author)
19
 - [Author](#author)
19
 - [Ported by](#ported-by)
20
 - [Ported by](#ported-by)
20
 - [License](#license)
21
 - [License](#license)
119
 
120
 
120
 ### Disqus
121
 ### Disqus
121
 
122
 
122
-You can optionally enable a comment system powered by Disqus for the posts. Simply add the variable `disqusShortname` to  your config file.
123
+You can optionally enable a comment system powered by Disqus for the posts. Simply add the variable `disqusShortname` to your config file.
123
 
124
 
124
 **TOML**
125
 **TOML**
125
 ```toml
126
 ```toml
128
 
129
 
129
 > **Note:** Previous version 1.0 the Disqus shortname had to be defined inside the `[params]` block.
130
 > **Note:** Previous version 1.0 the Disqus shortname had to be defined inside the `[params]` block.
130
 
131
 
132
+
133
+## Google Analytics
134
+
135
+Google Analytics can be enabled by assigning your tracking code to the `googleAnalytics` variable in the config file:
136
+
137
+**TOML**
138
+```toml
139
+googleAnalytics = "Your tracking code"
140
+```
141
+
142
+**YAML**
143
+```yaml
144
+googleAnalytics: Your tracking code
145
+```
146
+
131
 ## Author
147
 ## Author
132
 **Mark Otto**
148
 **Mark Otto**
133
 - <https://github.com/mdo>
149
 - <https://github.com/mdo>

+ 2
- 0
layouts/_default/baseof.html View File

4
     <div class="content container">
4
     <div class="content container">
5
     {{ block "main" . -}}{{- end }}
5
     {{ block "main" . -}}{{- end }}
6
     </div>
6
     </div>
7
+
8
+    {{ template "_internal/google_analytics_async.html" . }}
7
   </body>
9
   </body>
8
 </html>
10
 </html>