<footer class="footer">
  {% include footer-links.html %}
</footer>

{% if site.analytics %}
<script>
var doNotTrack = false;
if (!doNotTrack) {
  window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
  ga('create', '{{ site.analytics }}', 'auto');
  ga('send', 'pageview');
}
</script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
{% endif %}

<script>
  var shiftWindow = function() {
    if (location.hash.length !== 0) {
      window.scrollBy(0, -50);
    }
  };
  window.addEventListener("hashchange", shiftWindow);

  $(document).ready(function() {
    // Scroll to anchor of location hash, adjusted for fixed navbar.
    window.setTimeout(function() {
      shiftWindow();
    }, 1);

    // Flip the caret when submenu toggles are clicked.
    $(".sidebar-submenu").on("show.bs.collapse", function() {
      var toggle = $('[href$="#' + $(this).attr('id') + '"]');
      if (toggle) {
        toggle.addClass("dropup");
      }
    });
    $(".sidebar-submenu").on("hide.bs.collapse", function() {
      var toggle = $('[href$="#' + $(this).attr('id') + '"]');
      if (toggle) {
        toggle.removeClass("dropup");
      }
    });
  });
</script>
