]> njoseph.me Git - hyde.git/commitdiff
Add Google Analytics support
authordigitalcraftsman <digitalcraftsman@protonmail.com>
Thu, 7 Sep 2017 19:56:31 +0000 (21:56 +0200)
committerdigitalcraftsman <digitalcraftsman@protonmail.com>
Thu, 7 Sep 2017 19:56:31 +0000 (21:56 +0200)
Closes #44

README.md
layouts/_default/baseof.html

index 41f2d5e4328a143a957fd8cbe23b394dcbf022d1..82660cbfcd8ff7139d706c746532511378b729e4 100644 (file)
--- a/README.md
+++ b/README.md
@@ -15,6 +15,7 @@ It pairs a prominent sidebar with uncomplicated content.
   - [Themes](#themes)
   - [Reverse layout](#reverse-layout)
   - [Disqus](#disqus)
+  - [Google Analytics](#google-analytics)
 - [Author](#author)
 - [Ported by](#ported-by)
 - [License](#license)
@@ -119,7 +120,7 @@ params:
 
 ### Disqus
 
-You can optionally enable a comment system powered by Disqus for the posts. Simply add the variable `disqusShortname` to  your config file.
+You can optionally enable a comment system powered by Disqus for the posts. Simply add the variable `disqusShortname` to your config file.
 
 **TOML**
 ```toml
@@ -128,6 +129,21 @@ disqusShortname = "spf13"
 
 > **Note:** Previous version 1.0 the Disqus shortname had to be defined inside the `[params]` block.
 
+
+## Google Analytics
+
+Google Analytics can be enabled by assigning your tracking code to the `googleAnalytics` variable in the config file:
+
+**TOML**
+```toml
+googleAnalytics = "Your tracking code"
+```
+
+**YAML**
+```yaml
+googleAnalytics: Your tracking code
+```
+
 ## Author
 **Mark Otto**
 - <https://github.com/mdo>
index a45cf3722d212339a3134a5fedadd6e721e71560..0c87c3fa93d2ae3df84dbef75551dcb57c592889 100644 (file)
@@ -4,5 +4,7 @@
     <div class="content container">
     {{ block "main" . -}}{{- end }}
     </div>
+
+    {{ template "_internal/google_analytics_async.html" . }}
   </body>
 </html>
\ No newline at end of file