Skip to content

Commit

Permalink
Add support for Google Analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
elessar-ch committed Mar 10, 2021
1 parent 92e70ee commit 39b140b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,16 @@ comments: true
---
```

### Google Analytics

Tale supports Google Analytics integration using Hugo's provided `google_analytics_async` template.

To enable it, add the `googleAnalytics` tag to your `config.toml`. It will be added on all pages.

```toml
googleAnalytics = "UA-133700000-0"
```

### Custom summaries

Tale allows for writing the summary of your posts manually by setting the `summary` variable in the page frontmatter. If this variable is not set, the summary that Hugo automatically generates will be used.
Expand Down
2 changes: 2 additions & 0 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<head>
<!-- Google Analytics -->
{{ template "_internal/google_analytics_async.html" . }}
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{{- if .IsHome }}
Expand Down

0 comments on commit 39b140b

Please sign in to comment.