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

github.com/jbub/ghostwriter.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjbub <juraj.bubniak@gmail.com>2018-05-28 14:05:07 +0300
committerjbub <juraj.bubniak@gmail.com>2018-05-28 14:05:07 +0300
commit2340a01fea08ecfff62ee22551741180862156ce (patch)
tree01d3d7ae3643742c6215c2a26b835a459c36bd86
parent5b9400c068441b76d65c8855442d44b78b2f7108 (diff)
Implement hugo privacy config, set version 0.41.
-rw-r--r--README.md12
-rw-r--r--exampleSite/config.toml12
-rw-r--r--layouts/partials/google_analytics.html25
-rw-r--r--layouts/partials/header.html2
-rw-r--r--theme.toml2
5 files changed, 22 insertions, 31 deletions
diff --git a/README.md b/README.md
index 5c01116..73aad5c 100644
--- a/README.md
+++ b/README.md
@@ -46,6 +46,16 @@ copyright = "My Name"
googleAnalytics = "XXX"
disqusShortname = "XXX"
+[Privacy]
+
+[Privacy.disqus]
+ disable = true
+
+[Privacy.googleAnalytics]
+ anonymizeIP = true
+ respectDoNotTrack = true
+ useSessionStorage = false
+
[Author]
name = "My Name"
profile = "https://google.com/+XXX"
@@ -72,8 +82,6 @@ disqusShortname = "XXX"
dateFormat = "Mon, Jan 2, 2006"
highlightJsUrl = ""
highlightJsLocalUrl = ""
- googleAnalyticsAnonymizeIP = false
- googleAnalyticsRespectDoNotTrack = false
[Permalinks]
post = "/:year/:month/:day/:filename/"
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index f6d8efe..5b0c218 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -6,6 +6,16 @@ copyright = "My Name"
disqusShortname = "XXX"
googleAnalytics = "XXX"
+[Privacy]
+
+[Privacy.disqus]
+ disable = true
+
+[Privacy.googleAnalytics]
+ anonymizeIP = true
+ respectDoNotTrack = true
+ useSessionStorage = false
+
[Author]
name = "My Name"
profile = "https://google.com/+XXX"
@@ -32,8 +42,6 @@ googleAnalytics = "XXX"
dateFormat = "Mon, Jan 2, 2006"
highlightJsUrl = ""
highlightJsLocalUrl = ""
- googleAnalyticsAnonymizeIP = false
- googleAnalyticsRespectDoNotTrack = false
[Permalinks]
post = "/:year/:month/:day/:filename/"
diff --git a/layouts/partials/google_analytics.html b/layouts/partials/google_analytics.html
deleted file mode 100644
index 964a396..0000000
--- a/layouts/partials/google_analytics.html
+++ /dev/null
@@ -1,25 +0,0 @@
-{{ if .Site.GoogleAnalytics }}
-<script>
- {{ template "__ga_js_set_doNotTrack" $ }}
- if (!doNotTrack) {
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
- })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
- ga('create', '{{ .Site.GoogleAnalytics }}', 'auto');
-{{- if .Site.Params.googleAnalyticsAnonymizeIP }}
- ga('set', 'anonymizeIp', true);
-{{- end }}
- ga('send', 'pageview');
- }
-</script>
-{{ end }}
-
-{{- define "__ga_js_set_doNotTrack" -}}
- {{- if not .Site.Params.googleAnalyticsRespectDoNotTrack -}}
- var doNotTrack = false;
- {{- else -}}
- var dnt = (navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack);
- var doNotTrack = (dnt == "1" || dnt == "yes");
- {{- end -}}
-{{- end -}} \ No newline at end of file
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 1daf361..8ddb315 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -20,7 +20,7 @@
{{ partial "extra-in-head.html" . }}
</head>
<body>
- {{ partial "google_analytics.html" . }}
+ {{ template "_internal/google_analytics.html" . }}
<div id="wrapper">
<header class="site-header">
diff --git a/theme.toml b/theme.toml
index 9cb61d9..fdc2c7a 100644
--- a/theme.toml
+++ b/theme.toml
@@ -5,7 +5,7 @@ description = "A fork of simple AJAX driven theme for the Ghost blogging platfor
homepage = "https://github.com/jbub/ghostwriter"
tags = ["blog", "technical", "personal"]
features = ["blog", "technical", "personal"]
-min_version = 0.37
+min_version = "0.41"
[author]
name = "Juraj Bubniak"