diff --git a/docs/source/_assets/js/nav.js b/docs/source/_assets/js/nav.js index 4eb26411a..bfb5a4617 100644 --- a/docs/source/_assets/js/nav.js +++ b/docs/source/_assets/js/nav.js @@ -1,4 +1,11 @@ $.when($.ready).then(function() { + window.history.replaceState({ + 'href': window.location.href, + 'title': $(document).filter('title').text(), + 'nav': $(document).find('#nav').html(), + 'content': $(document).find('#content').html() + }, '', window.location.href) + $('#nav').on('click', 'a', function (event) { // Allow opening links in new tabs @@ -45,8 +52,10 @@ $.when($.ready).then(function() { }, '', href) // Track on Google Analytics - ga('set', 'page', href) - ga('send', 'pageview') + if (typeof(ga) === 'function') { + ga('set', 'page', href) + ga('send', 'pageview') + } }) }) @@ -59,8 +68,10 @@ $.when($.ready).then(function() { $('#content').html(e.state.content) // Track on Google Analytics - ga('set', 'page', e.state.href) - ga('send', 'pageview') + if (typeof(ga) === 'function') { + ga('set', 'page', e.state.href) + ga('send', 'pageview') + } } } diff --git a/docs/source/_layouts/documentation.blade.php b/docs/source/_layouts/documentation.blade.php index 720f144b8..e1d5936d4 100644 --- a/docs/source/_layouts/documentation.blade.php +++ b/docs/source/_layouts/documentation.blade.php @@ -14,6 +14,10 @@ @endsection +@push('headScripts') + +@endpush + @section('body')