|
@@ -18,28 +18,6 @@
|
|
|
<script src="{{ "/js/" | relURL }}{{ . }}"></script>
|
|
|
{{ end }}
|
|
|
|
|
|
- {{ with .Site.GoogleAnalytics }}
|
|
|
- <script>
|
|
|
- (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', '{{ . }}', 'auto');
|
|
|
- ga('send', 'pageview');
|
|
|
-
|
|
|
- /* Send outbound link click events */
|
|
|
- var links = document.querySelectorAll('a');
|
|
|
- Array.prototype.map.call(links, function(item) {
|
|
|
- if (item.host != document.location.host) {
|
|
|
- item.addEventListener('click', function() {
|
|
|
- var action = item.getAttribute('data-action') || 'follow';
|
|
|
- ga('send', 'event', 'outbound', action, item.href);
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- </script>
|
|
|
- {{ end }}
|
|
|
-
|
|
|
<!-- Code highlighting -->
|
|
|
{{ if $.Scratch.Get "highlight_enabled" }}
|
|
|
{{ $v := .Site.Params.highlight_version | default "9.9.0" }}
|