Skip to content

Commit

Permalink
Add Google Analytics support
Browse files Browse the repository at this point in the history
Closes spf13#44
  • Loading branch information
digitalcraftsman committed Sep 7, 2017
1 parent eab1974 commit 7cf2943
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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>
Expand Down
2 changes: 2 additions & 0 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
<div class="content container">
{{ block "main" . -}}{{- end }}
</div>

{{ template "_internal/google_analytics_async.html" . }}
</body>
</html>

0 comments on commit 7cf2943

Please sign in to comment.