diff --git a/README.md b/README.md index 800ea2b..54b6623 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ A minimal blog theme built for [Hugo](https://gohugo.io/) 🍜 - Blog posts can be tagged 🏷 - Mathematical notations are supported with KaTex 📐 - Sass/SCSS for styling ✨ +- Support for Google Analytics 📈 and Disqus 💬 ### Prerequisites diff --git a/exampleSite/config.toml b/exampleSite/config.toml index d96e099..f16be02 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -13,6 +13,12 @@ theme = "hugo-theme-codex" # This is only to get the exampleSite to work in this repo. themesDir = "../../" +# Add your Disqus shortname here. +# disqusShortname = "" + +# Add your Google Analytics identifier: UA-XXXXXXXX-X +# googleAnalytics = "" + # Optional params [params] # Follow the Hugo date/time format reference here: diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 328609e..26e9fe1 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -2,8 +2,6 @@ - - {{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} | {{ .Site.Title }}{{ end }} @@ -13,7 +11,6 @@ - {{ if isset .Site.Params "twitter" }} @@ -44,6 +41,10 @@ {{ end }} {{ block "links" . }} {{ end }} {{ partial "seo-schema.html" .}} + + {{- if not .Site.IsServer -}} + {{ template "_internal/google_analytics_async.html" . }} + {{- end -}} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index f150a6a..4857f1c 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -3,28 +3,34 @@ {{ end }} {{ define "main" }} -{{ $dateFormat := .Site.Params.dateFormat | default "Jan 2 2006" }} + {{ $dateFormat := .Site.Params.dateFormat | default "Jan 2 2006" }} -
-
-

{{.Title}}

- -
-
- {{ partial "anchored-headings.html" .Content }} - {{ if or .Params.math .Site.Params.math }} - {{ partial "math.html" . }} - {{ end }} -
- {{ partial "tags.html" .}} {{ partial "post-pagination.html" .}} -
-{{ end }} {{ define "footer" }} - -{{ end }} {{ define "scripts" }} - +
+
+

{{.Title}}

+ +
+
+ {{ partial "anchored-headings.html" .Content }} + {{ if or .Params.math .Site.Params.math }} + {{ partial "math.html" . }} + {{ end }} +
+ {{ partial "tags.html" .}} {{ partial "post-pagination.html" .}} +
+ + {{ template "_internal/disqus.html" . }} + +{{ end }} + +{{ define "footer" }} + +{{ end }} + +{{ define "scripts" }} + {{ end }}