Skip to content

Commit

Permalink
Create comments and analytics posts
Browse files Browse the repository at this point in the history
  • Loading branch information
Rihoj committed Feb 28, 2022
1 parent 032fdc2 commit 4db01b1
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 3 deletions.
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...
84 changes: 84 additions & 0 deletions content/posts/analytics/comments/index.md
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
30 changes: 30 additions & 0 deletions content/posts/analytics/google_analytics/index.md
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
```

0 comments on commit 4db01b1

Please sign in to comment.