diff --git a/website/source/assets/javascripts/analytics.js b/website/source/assets/javascripts/analytics.js index 0e7dff179..e6ad037bc 100644 --- a/website/source/assets/javascripts/analytics.js +++ b/website/source/assets/javascripts/analytics.js @@ -1,4 +1,6 @@ -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('turbolinks:load', function() { + analytics.page() + track('.downloads .download .details li a', function(el) { var m = el.href.match(/packer_(\d+\.\d+\.\d+)_(.*?)_(.*?)\.zip/) return { diff --git a/website/source/assets/javascripts/application.js b/website/source/assets/javascripts/application.js index 5d6f89378..ae70e571d 100644 --- a/website/source/assets/javascripts/application.js +++ b/website/source/assets/javascripts/application.js @@ -1,4 +1,5 @@ //= require jquery +//= require turbolinks //= require hashicorp/mega-nav //= require hashicorp/sidebar diff --git a/website/source/layouts/layout.erb b/website/source/layouts/layout.erb index 4db676070..90ab477e0 100644 --- a/website/source/layouts/layout.erb +++ b/website/source/layouts/layout.erb @@ -27,11 +27,18 @@ <%= title_for(current_page) %> + + <%= stylesheet_link_tag "application" %> - - - + + + <%= javascript_include_tag "application", defer: true %> + + + <%= yield_content :head %> @@ -106,22 +113,6 @@ - - <%= javascript_include_tag "application" %> - -