Selaa lähdekoodia

Add Google Analytics support

Closes #44
digitalcraftsman 7 vuotta sitten
vanhempi
commit
7cf2943ef4
2 muutettua tiedostoa jossa 19 lisäystä ja 1 poistoa
  1. 17
    1
      README.md
  2. 2
    0
      layouts/_default/baseof.html

+ 17
- 1
README.md Näytä tiedosto

@@ -15,6 +15,7 @@ It pairs a prominent sidebar with uncomplicated content.
15 15
   - [Themes](#themes)
16 16
   - [Reverse layout](#reverse-layout)
17 17
   - [Disqus](#disqus)
18
+  - [Google Analytics](#google-analytics)
18 19
 - [Author](#author)
19 20
 - [Ported by](#ported-by)
20 21
 - [License](#license)
@@ -119,7 +120,7 @@ params:
119 120
 
120 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 125
 **TOML**
125 126
 ```toml
@@ -128,6 +129,21 @@ disqusShortname = "spf13"
128 129
 
129 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 147
 ## Author
132 148
 **Mark Otto**
133 149
 - <https://github.com/mdo>

+ 2
- 0
layouts/_default/baseof.html Näytä tiedosto

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