diff --git a/_assets/javascripts/application.js b/_assets/javascripts/application.js index 803c9402b9529..2d0b54b2d99a0 100644 --- a/_assets/javascripts/application.js +++ b/_assets/javascripts/application.js @@ -1,20 +1,25 @@ //= require_self -// Initialize fluidbox - -$(function () { +$(document).on('turbolinks:load', function (event) { + // Initialize fluidbox $('.fluidbox-trigger').fluidbox(); -}) -// Initialize scrollreveal + // Track page views on Turbolinks + if (typeof ga === 'function') { + ga('set', 'location', event.data.url) + ga('send', 'pageview') + } -window.sr = ScrollReveal({ reset: true }); -sr.reveal('.reveal', { - distance: '0', - duration: 500, - easing: 'ease-in-out', - origin: 'top', - scale: 1, - reset: false, - viewFactor: 0 + // Initialize scrollreveal + sr.reveal('.reveal', { + distance: '0', + duration: 500, + easing: 'ease-in-out', + origin: 'top', + scale: 1, + reset: false, + viewFactor: 0 + }); }); + +window.sr = ScrollReveal({ reset: true }); diff --git a/_assets/javascripts/vendor.js b/_assets/javascripts/vendor.js index 820cf0e57436c..9798c80f56d35 100644 --- a/_assets/javascripts/vendor.js +++ b/_assets/javascripts/vendor.js @@ -2,4 +2,5 @@ //= require vendor/jquery-throttle-debounce.js //= require fluidbox //= require scrollreveal +//= require turbolinks5/dist/turbolinks.js //= require vendor/retina.js diff --git a/_layouts/post.html b/_layouts/post.html index 0a049ec150ff1..af6a8ad5d7747 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -38,14 +38,14 @@