From a0fa374844013dc323e8cf2ec6a06fbce5eb8ebf Mon Sep 17 00:00:00 2001 From: Jeff Escalante Date: Fri, 20 Apr 2018 14:15:48 -0400 Subject: [PATCH] bring back turbolinks and adjust scripts to match --- .../source/assets/javascripts/analytics.js | 4 ++- .../source/assets/javascripts/application.js | 1 + website/source/layouts/layout.erb | 29 +++++++------------ 3 files changed, 14 insertions(+), 20 deletions(-) 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" %> - -