shithub: hugo

Download patch

ref: 2e6712e2814f333caa807888c1d8a9a5a3c03709
parent: 65deb72dc4c9299416cf2d9defddb96dba4101fd
author: Christian Oliff <[email protected]>
date: Sun Jun 10 02:47:44 EDT 2018

tpl: Always load GA script over HTTPS


--- a/hugolib/embedded_templates_test.go
+++ b/hugolib/embedded_templates_test.go
@@ -50,7 +50,7 @@
 	b.AssertFileContent("public/index.html",
 		"'anonymizeIp', true",
 		"'script','https://www.google-analytics.com/analytics.js','ga');\n\tga('create', 'ga_id', 'auto')",
-		"<script async src='//www.google-analytics.com/analytics.js'>")
+		"<script async src='https://www.google-analytics.com/analytics.js'>")
 
 	// Disqus
 	b.AssertFileContent("public/index.html", "\"disqus_shortname\" + '.disqus.com/embed.js';")
--- a/tpl/tplimpl/embedded/templates.autogen.go
+++ b/tpl/tplimpl/embedded/templates.autogen.go
@@ -163,7 +163,7 @@
 	ga('send', 'pageview');
 }
 </script>
-<script async src='//www.google-analytics.com/analytics.js'></script>
+<script async src='https://www.google-analytics.com/analytics.js'></script>
 {{ end }}
 {{- end -}}`},
 	{`google_news.html`, `{{ if .IsPage }}{{ with .Params.news_keywords }}
--- a/tpl/tplimpl/embedded/templates/google_analytics_async.html
+++ b/tpl/tplimpl/embedded/templates/google_analytics_async.html
@@ -23,6 +23,6 @@
 	ga('send', 'pageview');
 }
 </script>
-<script async src='//www.google-analytics.com/analytics.js'></script>
+<script async src='https://www.google-analytics.com/analytics.js'></script>
 {{ end }}
-{{- end -}}
\ No newline at end of file
+{{- end -}}