forked from hugo-toha/guides
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
relates to hugo-toha/toha#543
- Loading branch information
Showing
4 changed files
with
115 additions
and
3 deletions.
There are no files selected for viewing
4 changes: 1 addition & 3 deletions
4
content/posts/analytics/index.md → content/posts/analytics/_index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
--- | ||
title: "Analytics and Comments" | ||
date: 2020-06-08T06:00:23+06:00 | ||
description: Adding analytics and disquss comment in hugo theme Toha | ||
description: Adding analytics and comments in hugo theme Toha | ||
menu: | ||
sidebar: | ||
name: Analytics & Comments | ||
identifier: analytics-and-comments | ||
weight: 600 | ||
--- | ||
|
||
### Complete Post Coming Soon... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
--- | ||
title: "Comments" | ||
date: 2020-06-08T06:00:23+06:00 | ||
description: Adding comments in hugo theme Toha | ||
author: | ||
name: James Ray | ||
image: images/author/james.jpg | ||
menu: | ||
sidebar: | ||
name: Comments | ||
identifier: comments | ||
parent: analytics-and-comments | ||
weight: 200 | ||
--- | ||
|
||
## Comments | ||
|
||
Comments can be provided by a few different plugins. Your options are [Disqus](https://disqus.com/), [Valine](https://valine.js.org/), [Utterances](https://utteranc.es/), or [Giscus](https://giscus.app/). | ||
|
||
### Disqus | ||
Disqus is a popular comment plug-in. After signing up to [Disqus](https://disqus.com/) you will need to provide your shortname in your config file, and you will be good to go. You can provide it in two locations. The first is in the root of your site configuration as `DisqusShortname`. Or as a param feature as shown here: | ||
|
||
```yaml | ||
params: | ||
features: | ||
comment: | ||
enabled: true | ||
disqus: | ||
shortName: your-disqus-shortname | ||
``` | ||
### Valine | ||
[Valine](https://valine.js.org/) appears to be a Chinese comments comments plugin. Therefore my information on this will be limited to the configuration. | ||
```yaml | ||
valine: | ||
appId: app-id | ||
appKey: app-key | ||
avatar: avatar | ||
placeholder: placeholder | ||
lang: lang | ||
recordIP: recordIP | ||
enableQQ: enableQQ | ||
``` | ||
### Utterances | ||
Utterances uses [GitHub Issues](https://docs.github.com/en/issues/tracking-your-work-with-issues/about-issues) to store the comments for your posts. This requires you to allow have a public repository, and the Utterances app to use your repository. Setup instructions can be found at the [Utterances home page](https://utteranc.es/). | ||
```yaml | ||
params: | ||
features: | ||
comment: | ||
enabled: true | ||
utteranc: | ||
repo: your-repo/name | ||
issueTerm: url | ||
theme: light | ||
``` | ||
### Giscus | ||
Giscus is based off Utterances, but uses [GitHub Discussions](https://docs.github.com/en/discussions) as the backend. This requires you to allow have a public repository, and the Giscus app to use your repository. Setup instructions can be found at the [Giscus home page](https://giscus.app/). This will also allow you to look at some of the configuration options. | ||
To enable Giscus you will need to set the following items in your configuration file | ||
```yaml | ||
params: | ||
features: | ||
comment: | ||
enabled: true | ||
giscus: | ||
repo: your-repo/name | ||
``` | ||
Optional Parameters and defaults are as follows: | ||
```yaml | ||
category: General | ||
theme: light | ||
map: url | ||
reaction: 1 | ||
metadata: 0 | ||
inputPosition: bottom | ||
crossOrigin: anonymous | ||
``` |
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
title: "Google Analytics" | ||
date: 2020-06-08T06:00:23+06:00 | ||
description: Adding analytics in hugo theme Toha | ||
hero: hero.svg | ||
author: | ||
name: James Ray | ||
image: images/author/james.jpg | ||
menu: | ||
sidebar: | ||
name: Google Analytics | ||
identifier: google-analytics | ||
parent: analytics-and-comments | ||
weight: 100 | ||
--- | ||
|
||
## Analytics | ||
|
||
Currently the Toha theme only supports Google Analytics. This can be accomplished by providing a [Tracking ID (property number) or Measurement ID](https://support.google.com/analytics/answer/7372977?hl=en). Toha is will detect which version you are using and either provide the v3 or v4 google analytics. You can define the `googleAnalytics` variable in the root configuration level and Toha takes care of the rest. | ||
|
||
For more information about Google Analytics please see [Google's About Page](https://marketingplatform.google.com/about/analytics/) | ||
|
||
|
||
```yaml | ||
googleAnalytics: G-1234x345 | ||
``` | ||
```yaml | ||
googleAnalytics: UA-1234891234 | ||
``` |