Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/runningstream/hugograyscale.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrunningstream <runningstreamllc@gmail.com>2019-06-09 05:26:41 +0300
committerrunningstream <runningstreamllc@gmail.com>2019-06-09 05:26:41 +0300
commitddf6f3107de173614ee3ddcfd7084f204efd6dd5 (patch)
tree2b1a4f7d77ba2bbe0ec9b4ca69a6b6c5dc040c44
parent6c7f028cd3ed82b796e2617d752ce7c94a469fc7 (diff)
Add head tag and googleAnalytics
-rw-r--r--exampleSite/config.toml1
-rw-r--r--exampleSite/config_for_github_pages.toml1
-rw-r--r--layouts/_default/baseof.html4
-rw-r--r--layouts/partials/head.html12
4 files changed, 17 insertions, 1 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 89d6f20..4734534 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -6,3 +6,4 @@ theme = "grayscale"
# Provide some metadata for search and indexing services
description = "A port of the Grayscale theme to Hugo"
author = "RunningStream"
+ #googleAnalytics = ""
diff --git a/exampleSite/config_for_github_pages.toml b/exampleSite/config_for_github_pages.toml
index 2ab2bc3..b91f90e 100644
--- a/exampleSite/config_for_github_pages.toml
+++ b/exampleSite/config_for_github_pages.toml
@@ -6,3 +6,4 @@ theme = "grayscale"
# Provide some metadata for search and indexing services
description = "A port of the Grayscale theme to Hugo"
author = "RunningStream"
+ #googleAnalytics = ""
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index ab8d12d..674ae1b 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -1,6 +1,8 @@
<!doctype html>
<html lang="{{ .Site.LanguageCode }}">
- {{- partial "head.html" . -}}
+ <head>
+ {{ partial "head.html" . }}
+ </head>
<body id="page-top">
{{- partial "header.html" . -}}
{{- block "main" . }}{{- end }}
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 9e31330..21b9921 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -25,3 +25,15 @@
<!-- Custom styles for this template -->
<link href="{{ "css/grayscale.min.css" | relURL }}" rel="stylesheet">
+
+ {{ with .Site.Params.googleAnalytics }}
+ <!-- Global site tag (gtag.js) - Google Analytics -->
+ <script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script>
+ <script>
+ window.dataLayer = window.dataLayer || [];
+ function gtag(){dataLayer.push(arguments);}
+ gtag('js', new Date());
+
+ gtag('config', '{{ . }}');
+ </script>
+ {{ end }}