- split head partial into head-meta and head-scripts
- consolidate gtags script
--- /dev/null
+{{! Add additional meta tags here}}
--- /dev/null
+{{#if site.keys.googleAnalytics}}
+{{#with site.keys.googleAnalytics}}
+ <script async src="https://www.googletagmanager.com/gtag/js?id={{this}}"></script>
+ <script>function gtag(){$gtag.push(arguments)}$gtag=window.dataLayer||[],gtag("js",new Date),gtag("config","{{this}}");</script>
+{{/with}}
+{{/if}}
-{{#if site.keys.googleAnalytics}}
-<script async src="https://www.googletagmanager.com/gtag/js?id={{site.keys.googleAnalytics}}"></script>
-<script>
-window.dataLayer=window.dataLayer||[];
-function gtag(){dataLayer.push(arguments);}
-gtag('js',new Date());
-gtag('config','{{site.keys.googleAnalytics}}');
-</script>
-{{/if}}
+{{> head-meta}}
+{{> head-scripts}}